can a While statement only have one condition or can it have more than one condition?
example
While A = 1 AND B < 10
B = B + 1
Wend
can a While statement only have one condition or can it have more than one condition?
example
While A = 1 AND B < 10
B = B + 1
Wend
I am not sure if you can have more than one condition in a WHILE WEND (although it would be easy enough to find out with a test program). If you can't have more than one condition then you could try to nest more than one WHILE WEND.
Ex:
WHILE A = 1
WHILE B < 10
LET B = B + 1
WEND
WEND
Just an idea
The manual says 'Condition may be any comparison expression.'. So, while it doesn't specifically say that you can, it doesn't specifically say that you can't...use multiple expression's....or even nested While/Wend statements.
I think I'd still put the comparison inside parenthesis to avoid confusing the compiler.
Here is how I would do it (which wasn't your question). The nested WHILE WEND loops to simulate the AND condition can be tricky and are not as straight forward as they appear.
Code:Loop: If A=1 THEN IF B < 10 THEN B=B+1 GOTO Loop ENDIF ENDIF
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Hey, a question from Melanie at last!!! Aimed at Paul though, being an avid sci-fi fan, I feel I should recognise your Avatar as Klingon or Cylon or something?
nice eye - my name tells all
Paul Borgmeier
Salt Lake City, UT
USA
__________________
while (selected = tag) and (tmr < duration)
...
wend
Bookmarks