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
__________________
while (selected = tag) and (tmr < duration)
...
wend
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
__________________
another hint for Melanie (attached)
(you are now 8 of 9)
certainly more readable butOr just
Loop:
IF A = 1 AND B < 10 THEN
B = B + 1
GOTO Loop
ENDIF
1) takes longer to evaluate in PIC time
2) takes more code space
{!r]
Last edited by paul borgmeier; - 8th July 2007 at 07:08. Reason: color adjust
Paul Borgmeier
Salt Lake City, UT
USA
__________________
*laughs* I didn't need the hint...
But I did think the Borg having a Logo is kinda illogical. Logo's are really a projection of power or identity... so, Klingon's yes, Romulans yes, even Starfleet, but for a bunch of bio-mechanical automatons that assimillated everything they came across, I didn't think they would need (or even collectively recognise the need for) a logo for 'brand awareness'. Next they'll be having a "mission statement"...
Hmmm... interesting accessory for the cat-suit... female Borg in tight leather... oh, they've already done that...
Bookmarks