Page 3 of 3

Posted: Fri Jan 27, 2006 4:24 pm
by Dare2
MikeB wrote:I'm not quite sure what this is supposed to do
I'll hazard a guess that these are examples of an IN condition. So

Code: Select all

If "test" In "this is a test"
  ; do something as "test" sequence is found IN "this is a test"
Endif
If "best" In "this is a test"
  ; would not do anything, no "best" IN "this is a test"
Endif 

Dim myArray.b(10) 
For i=0 to 10 
    myArray(i)=i 
Next 
If 129 In myArray()
  ; Nothing done, array does not contain 129 in any element
Endif
If 2 In myArray()
  ; Does something as array does contain 2 in an element
Endif
Just guessing. The first is FindString in disguise?

Posted: Fri Jan 27, 2006 4:26 pm
by netmaestro
Findstring it is. And Findstring is even better because you can potentially speed it up by specifying a start point.

Posted: Fri Jan 27, 2006 5:57 pm
by Flype
Yes you guessed well. My examples were not very clear, sorry.
There's many case where the In statement should be usefull, just look at others languages like python, sql, and many others... I agree with the fact it could be slower, cleaner but slower. The 'In' keyword is commonly used with 'sets'. But remember what i said, i was just dreaming...