-
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?
-
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?
-
you should be able to go
?asc(left(Array(3), 1))
and hit return in the debug window to find the ascii value.
-
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>
-
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
-
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.
-
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?
-
Well it's not always going to be the same.
-
so maybe I'll just fix this problem from the originating point in the program
Thanks for your help!