|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Topic # 1397 |
WHILE Y>X AND S |
30/04/2006 @ 06:58 by bh77a
|
Hi,
This is probably a foolish question on my behalf, but trying to enter into a WHILE/WEND loop with the WHILE set up as:
WHILE Y>X AND S<=5
results in a syntax error at compilation. Is this not possible or should it be nested? See below:
WHILE Y>X WHILE S<=5
Thanks for any clarification that one could provide.
bh77a |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1 -------- 30/04/2006 @ 18:09 by aldweb
visitor |
Hi bh77a,
Here is how to proceed:
A=(Y>X) AND (S<=5) WHILE A=TRUE ... A=(Y>X) AND (S<=5) WEND
This is because the math parser is not fully implemented (yet?) except for real variables affectations, i.e. A=something. In all other statements, you need to have only one active boolean test (i.e. [=,<=,>=,<>,<,>]. This should be written somewhere in the faq, apart from being clearly stated in the WHILE statement's syntax.
Cheers, aldweb
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2 -------- 30/04/2006 @ 23:15 by bh77a
visitor |
Hi Aldweb,
Your explanation makes good sense.
I also solved it by:
WHILE S<=5 IF Y>X ... ENDIF WEND
Regards, bh77a |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3 -------- 01/05/2006 @ 20:37 by aldweb
visitor |
Hi,
This will also work of course. You just have to be careful that the S value can be set to a new condition value not only in the IF Y>X / ENDIF loop, otherwise you shall never exit the WHILE loop!
Cheers
@+ aldweb |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 4 -------- 02/05/2006 @ 04:23 by bh77a
visitor |
Hi,
Very true. Fortunately this doesn't occur in my test loop.
Regards, bh77a |
|
|
topic active
topic closed
Sticky
New message -
Correct message
Close topic
Make sticky
|
|