Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

A survey on ALLTRIM as a Pain in the neck

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: A survey on ALLTRIM as a Pain in the neck

    Help for parts of v8, v9, v10 are now in those 3 places....4 counting this messageboard!

    ...and thank God for this message board ;)

    Comment


      #17
      Re: A survey on ALLTRIM as a Pain in the neck

      Ok,
      I found another way to de-pad a number into a string, ie str(###).
      Try
      ?STR(219,0)
      I like that better than
      ltrim(str(###))
      xBasic STR(###,[n],[c])
      does many things towards formatting a number-to-string than most other STR()-used languages.
      Last edited by SMARTII; 11-19-2009, 11:13 AM.
      First Love

      Comment


        #18
        Re: A survey on ALLTRIM as a Pain in the neck

        nice looking car
        looks like a 52 Mecury, or maybe Lincoln
        Cole Custom Programming - Terrell, Texas
        972 524 8714
        [email protected]

        ____________________
        "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

        Comment


          #19
          Re: A survey on ALLTRIM as a Pain in the neck

          Originally posted by martinwcole View Post
          nice looking car
          looks like a 52 Mecury, or maybe Lincoln
          '54 first year they stopped using flat-head eng's. in the USA.
          This was the first Ford OHV V-8 in Mercury/Ford products.
          Cadillac had used an OHV since 1949.
          This '54 Merc happens to have the Cad Engine.
          Good to hear from you..make sure u click my Sig! (Gives me goosebumps. Esp MR BLUE at 8.26sec in a V6)
          First Love

          Comment


            #20
            Re: A survey on ALLTRIM as a Pain in the neck

            MAN, nice looking engine!!! - looks like 6 deuces

            my hot rod claim to fame was in 1960 I had a 1960 red and white Impala 2dr hard top, with as I remember the 348 engine.

            Anyway, put in 3/4 racing cam - bent the vales twice shifting from 1st to second dragging, had to put in notched pistons - I was the talk of the Dairy Queen for a while, cruising thru with a gal.

            those were the days!!
            Cole Custom Programming - Terrell, Texas
            972 524 8714
            [email protected]

            ____________________
            "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

            Comment


              #21
              Re: A survey on ALLTRIM as a Pain in the neck

              That 348 became the famous "409" of the Beach-Boys song.
              And now the earliest "348" in my favorite '50's Color again:
              First Love

              Comment


                #22
                Re: A survey on ALLTRIM as a Pain in the neck

                Going on memory, the first OHV V8 was Chevrolet in 1918 or 1919.

                Olds had the rocket OHV V8 in 1949 also.

                Ford flat head was giving up too much the the Chev 6(mostly truck engines) on shortrcacks in the early 50's so the more powerful OHV V8 from ford. chevrolet followed in 1955 with the 265.

                .
                Dave Mason
                [email protected]
                Skype is dave.mason46

                Comment


                  #23
                  Re: A survey on ALLTRIM as a Pain in the neck

                  Originally posted by SMARTII View Post
                  Ok,
                  I found another way to de-pad a number into a string, ie str(###).
                  Try
                  ?STR(219,0)
                  I like that better than
                  ltrim(str(###))
                  xBasic STR(###,[n],[c])
                  does many things towards formatting a number-to-string than most other STR()-used languages.
                  Interesting. I didn't realize it would do that. However, I just hope that's not a "bug" that will get fixed sometime in the future. It certainly does create a problem if you use 1 instead of the 0 and I couldn't find anything that says the 0 is an acceptable option.

                  Sometimes things like this are unintentional and work for awhile then get "fixed" in a future update. Until I see something that says this function is supposed to work like that when a zero length is specified, I think I'll stick with ltrim(str()) which I know should always work.

                  Perhaps another reason for using ltrim(str()) is that there is no question of the intent. It's entirely possible that someone reading your code in the future (maybe even you - the original developer) would question why the 0 was used and whether it was a typo - maybe is was supposed to be 10 or even 20. Sometimes the extra spaces are desirable for formatting and/or parsing.

                  Just some additional "points to ponder" - do whatever works for you.

                  Comment


                    #24
                    Re: A survey on ALLTRIM as a Pain in the neck

                    Great Memory!
                    The "jimmy" six had more cu in and a heavy duty main bearing web that allowed double the stock HP.
                    BTW, that Chevy 288 cu in (4.7 L) 1918 OHV8 (pic) produced 36HP. About the same as a big John Deere Riding mower. It took 8cu in to produce 1hp.
                    Today's race engines easily produce 4hp/1cu in.
                    Stock 2010 production cars avg about 1.3hp/1 cu in.
                    And all this is possible by GREAT software based design.
                    First Love

                    Comment


                      #25
                      Re: A survey on ALLTRIM as a Pain in the neck

                      You're right Cal.
                      But I figured the "0" meant 0 padding so that's what I tried.
                      The XBASIC intent was to control the padding to a specified amount.
                      BUT your value better be <= the len of that pad value when converted to a string!
                      Ex:
                      ?str(524,2)
                      = ""

                      If you did STR(524,2) you will get nothing but Chr(127)'s.
                      In my case I have to pad a STR(###) with 0's so it is alway the same fixed length.
                      So I still have to add a "PADL()" .
                      Ex:
                      ? padl(str(3,1),8,"0")
                      = "00000003"

                      RE:"..original developer) would question why the 0 was used and whether it was a typo - ..."
                      Fortunately I'm Comment obsessed.
                      Originally posted by CALocklin View Post
                      Interesting. I didn't realize it would do that. However, I just hope that's not a "bug" that will get fixed sometime in the future. It certainly does create a problem if you use 1 instead of the 0 and I couldn't find anything that says the 0 is an acceptable option.

                      Sometimes things like this are unintentional and work for awhile then get "fixed" in a future update. Until I see something that says this function is supposed to work like that when a zero length is specified, I think I'll stick with ltrim(str()) which I know should always work.

                      Perhaps another reason for using ltrim(str()) is that there is no question of the intent. It's entirely possible that someone reading your code in the future (maybe even you - the original developer) would question why the 0 was used and whether it was a typo - maybe is was supposed to be 10 or even 20. Sometimes the extra spaces are desirable for formatting and/or parsing.

                      Just some additional "points to ponder" - do whatever works for you.
                      Last edited by SMARTII; 11-19-2009, 01:32 PM.
                      First Love

                      Comment


                        #26
                        Re: A survey on ALLTRIM as a Pain in the neck

                        I'm with Cal on this. If it isn't documented, it is subject to change. If you really hate the LTRIM(STR()), then create a function (say LS() ), but it will be a bit slower.

                        Originally posted by SMARTII View Post
                        Fortunately I'm Comment obsessed.
                        As for documentation, about 30% of the code bytes I write is documentation. Are you going to write more documentation explaining the anamoly than just using the LTRIM(STR())? Doesn't seem to be a win from my perspective!
                        Regards,

                        Ira J. Perlow
                        Computer Systems Design


                        CSDA A5 Products
                        New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                        CSDA Barcode Functions

                        CSDA Code Utility
                        CSDA Screen Capture


                        Comment


                          #27
                          Re: A survey on ALLTRIM as a Pain in the neck

                          Originally posted by csda1 View Post
                          If you really hate the LTRIM(STR()), then create a function ...
                          Awhile back, I created UDF's for this purpose as stated in the Wishlist thread below
                          http://msgboard.alphasoftware.com/al...ad.php?t=72480

                          While strim() does what is being discussed, strimpad() pads left with zeroes to a default length of 8:
                          Code:
                          ?strimpad(35)
                          = "00000035"
                          ?strimpad(35,5)
                          = "00035"
                          I use these frequently throughout my applications. However, if I knew all along that ""+44 was the equivalent of strim(44), I may not have gone this route. It's questionable though I've grown accustomed to using strim().

                          Steve

                          Comment


                            #28
                            Re: A survey on ALLTRIM as a Pain in the neck

                            Hi Steve,

                            One of Cal and my cardinal rules is never depend on implicit type conversions like this, ""+44 (unless officially documented and supported). There is too much chance that a future release will break it.

                            Originally posted by Steve Andrews View Post
                            However, if I knew all along that ""+44 was the equivalent of strim(44), I may not have gone this route.
                            However, assuming you did want to depend on or use a questionable technique, in most cases just embed it in your own function. Had you used that technique in your Strim() function, then if a release of Alpha did break it, you would just have to fix it in that one function, without any other changes of your code.

                            This is one of the key reasons to use functions and not scripts. Scripts can not be used in expressions, whereas functions (well normal ones anyway) can!
                            Regards,

                            Ira J. Perlow
                            Computer Systems Design


                            CSDA A5 Products
                            New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                            CSDA Barcode Functions

                            CSDA Code Utility
                            CSDA Screen Capture


                            Comment


                              #29
                              Re: A survey on ALLTRIM as a Pain in the neck

                              Another nit-picky point is that most automatic conversions take longer. As simple as it is, even the last method given above takes slightly longer. (Not that most people would notice in this case.)
                              Try it:
                              Code:
                              stime = now()
                              FOR qx = 1 to 100000
                                  result = "" + 44
                              NEXT
                              ui_msg_box( "TIME", ltrim(str(now()-stime,10,3 )) )
                              
                              'This one is about 0.1 seconds faster - at least on my computer.
                              stime = now()
                              FOR qx = 1 to 100000
                                  result = ltrim(str(44))
                              NEXT
                              ui_msg_box( "TIME", ltrim(str(now()-stime,10,3 )) )
                              What really shocked me was that I tested the above in v9 and v7 - v7 took much longer to run both methods (50%?) but the percent difference between the two methods was about the same.

                              Comment


                                #30
                                Re: A survey on ALLTRIM as a Pain in the neck

                                Just for the information,
                                What would:
                                result = str(44,2)

                                Time at relatively?
                                I get 1.835 for ""+44
                                vs
                                1.616 for str(44,2)
                                On an AMD quad C:
                                PHP Code:
                                result "" 44          1.329
                                result 
                                ltrim(str(44))   1.203    9.48better.
                                result str(44,2)        1.187  10.6better 
                                Last edited by SMARTII; 11-21-2009, 03:40 PM.
                                First Love

                                Comment

                                Working...
                                X