Results 1 to 9 of 9

Thread: Strings

  1. #1

    Thread Starter
    Addicted Member Booda's Avatar
    Join Date
    Aug 2001
    Location
    B.C, Canada
    Posts
    237

    Strings

    Hi all!

    I have an array of strings that I'm loading in from another array of strings.
    When i run the run the program in debug mode i want to check for a string that had nothing loaded into it.
    when I put my cursor over the array in question with nothing loaded into it it shows

    Array(3) = "(a bunch of squares)"
    what I want to know is what are thoes squares and how can I test for them?

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    That 'bunch of squares' are unprintable characters. One way to avoid them would be to clear your array before you use it; eg;

    for dummy=1 to 100
    MyArray(dummy)=""
    next

    Also - how are unprintable characters getting into that array in the first place..? Couldn't you do something where you are storing the orginal data to ensure only 'clean' data gets in?
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  3. #3
    Fanatic Member Bonker Gudd's Avatar
    Join Date
    Mar 2000
    Location
    Saturn
    Posts
    748
    you should be able to go
    ?asc(left(Array(3), 1))
    and hit return in the debug window to find the ascii value.

  4. #4
    Frenzied Member jjortiz's Avatar
    Join Date
    Mar 2001
    Location
    NYC
    Posts
    1,768
    The squares are characters that you are loading some how into the array. What you can do is pull open the immediate window. The icon is represented by a little window with a yellow exclamation point and then do the following
    btw the window toolbar will appear at the bottom.
    ?array(3) <enter>

  5. #5

    Thread Starter
    Addicted Member Booda's Avatar
    Join Date
    Aug 2001
    Location
    B.C, Canada
    Posts
    237
    I just tried that with the immediate window and it says that ot was a 0.......strange
    how it got in there the first place I don't know
    the array that Im using is a dynamic array loaded in a previous form.
    I guess I'll have to go back and find out why that is happening.
    I mean there are suppose to be some blank entries in this array but a bunch of 0's mmmm

  6. #6
    Frenzied Member jjortiz's Avatar
    Join Date
    Mar 2001
    Location
    NYC
    Posts
    1,768
    If i am not wrong is the memory that it is allocating for the array. That's why it displays a zero and when you place the mouse over it gives you unprintable characters. Do not quote me on this.

  7. #7

    Thread Starter
    Addicted Member Booda's Avatar
    Join Date
    Aug 2001
    Location
    B.C, Canada
    Posts
    237
    one other thing if I want to test for that, I tried

    If array(3) = "00000" then
    'do whatever
    end if

    and it didn't seem to work, is there a asc angle that I'm missing here?

  8. #8
    Frenzied Member jjortiz's Avatar
    Join Date
    Mar 2001
    Location
    NYC
    Posts
    1,768
    Well it's not always going to be the same.

  9. #9

    Thread Starter
    Addicted Member Booda's Avatar
    Join Date
    Aug 2001
    Location
    B.C, Canada
    Posts
    237
    so maybe I'll just fix this problem from the originating point in the program

    Thanks for your help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width