Friday, March 25, 2011

Arrays - Searching

Do While FOUND = False AND SLOT <= ArrayLength            This will stop the looping at the 
If Array(SLOT) = SearchText then                                                           after checking the final slot
FOUND = True
Else
SLOT = SLOT + 1
Loop
If FOUND = True then
Message = "Yeah!"
else 
Message = "Not Found"
SLOT will start at 0 as a new variable that you would have DIM'd if making a full program
Remember you don't bother DIM'ing variables in the Exam

No comments:

Post a Comment