Edit: I changed the name of the topic because I added an example of the SOME function in a later post, since the two are so similar.
As I practice and learn, I'll put my examples here for ones that don't have an example in the help file. If someone can come up with a better version than mine, great. If there is something you would like to change about mine, that's fine, too.
[code=thinbasic]
' ALL function example
' ----------------------
DIM n AS INTEGER, x AS INTEGER, y AS INTEGER, z AS INTEGER
x = 5
y = 4
z = 6
n = ALL( x = 5, x > y, x < z ) 'n will be 1 if all of these are true, 0 if one or more is false
IF n = 1 THEN
MSGBOX 0, "1st time True"
ELSE
MSGBOX 0, "1st time False"
END IF
n = ALL( x = 5, x > y, x > z ) 'this time it will be false because x is not greater than z
IF n = 1 THEN
MSGBOX 0, "2nd time True"
ELSE
MSGBOX 0, "2nd time False"
END IF
[/code]
Mark
Bookmarks