Announcement

Collapse
No announcement yet.

TRIM$, ANY - "feature"..

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

  • TRIM$, ANY - "feature"..

    Discovered funny thing. TRIM$ trims away any character at end and start,
    but using ANY to remove characters inside a string, it only handles up to
    ASCII 127? Copy,paste and test following to see - result will be "Börje",
    without leading/ending "ö". Should be "Brje"..
    Code:
      LOCAL txt AS STRING
      txt = "öBörjeö"
      MSGBOX TRIM$(txt, ANY "ö")
    Found this "feature" when trying to trim away strange ASCII 160 from
    inside result in textbox with MS UpDown control attached to it. UpDown
    formats values above 999 by inserting CHR$(160) as thousand separator.

    Simple fix, use REMOVE$(txt, ANY "ö") instead - it works like expected..


    ------------------

  • #2
    Forget it. TRIM$ is supposed to work that way, I see that now. Seems
    I managed to use REMOVE$ on my brain there..


    ------------------

    Comment


    • #3
      That is a known issue.... it is called "faulty programmer"

      ------------------
      Lance
      PowerBASIC Support
      mailto:[email protected][email protected]</A>
      Lance
      mailto:[email protected]

      Comment


      • #4
        You'd think that by now with GHz processors and PowerBasic
        that the compiler would just read your mind and do what you
        want , not what you say...


        ------------------
        Jim Padgett
        mailto:[email protected][email protected]</A>
        Warped by the rain, Driven by the snow...

        jimatluv2rescue.com

        Comment


        • #5
          Scary thought. If the compiler could read what's left of my mind at 3 o'clock in
          the morning, it would simply say "there's no hope" and commit GPF right away..


          ------------------

          Comment


          • #6
            Somehow I don't think this is about paintbrushes and artists.

            It's more like keeping one's crayon inside the lines.

            MCM
            (No, Borje, you're not going to live this one down any time soon).


            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              Error:
              User Error
              Please replace user and press Ctrl Alt Delete to reboot your machine.





              ------------------

              Comment


              • #8
                Machine is ok. Better to do a Ctrl+Alt+Del on my brain instead..

                Never been good at keeing the crayon inside the lines. Like to be
                flexibel, which is one of the reasons I love the PB compiler so much.
                It adds a dimension of "artistic" freedom I have never encountered in
                any other language/compiler. DDT, SDK, resource file dialogs, inline
                ASM - even third-party visual designers like EZGUI, etc? Anything goes.
                With PB, we are allowed to rule over our code.

                Love it, even if it means my poor old mind sometimes gets confused by
                all the neat ways to do things in PB and I start doing stupid mistakes
                like this one..


                ------------------

                Comment

                Working...
                X