Re: while do & end while

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi again timelord,

<snip>

> I have another question?  if you want condition1 to exit 
> when False or 0, just add NOT after the condition???
> 
> atom condition1
> while 1 do
>   condition1 = rand(10)
>   if condition1 NOT then exit end if    
> end while

If you really have condition1=0, i.e. False,
then you *must* to say :

if not condition1 then exit end if

to get 1, Truth, and exit loop.

But rand(10) is Truth anyway, these numbers 
are from 1 to 10, so if you'll say:

if not condition1 then exit end if

then you get just zeros, False, 
and your loop is ***infinite***.

Do not play with infinite loops ! :-[

Read the manual, refman.doc or refman.htm !

Good Luck With Good Loops ! smile

Regards,
Igor Kachan
kinz at peterlink.ru

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu