Computer Science Canada

Exit When

Author:  WesWes [ Sun Dec 15, 2002 6:34 pm ]
Post subject:  Exit When

Hey,

I was wondering if someone can give me an example of an exit out of a loop...

I really need it...just like the other people on this message board.

So far, this is what I have:

%Calculation Screen
procedure calc
for c : 7 .. 10
locate (10, 25)
color (c)
put "Calculting"
delay (500)
end for
end calc

%-------Calculation Screen
loop
calc
exit when calc = 4
end loop

But the "calc = 4" part doesn't work.

All suggestions would be greatly appreciated. Thanks for your time.

Author:  Tony [ Sun Dec 15, 2002 6:37 pm ]
Post subject: 

thats because calc is a procedure, not a function so it doesn't return a value so it doesn't equal to anything.

so you can ether change your procedure to a function or compare some other variable for exit statment

Author:  WesWes [ Sun Dec 15, 2002 6:56 pm ]
Post subject: 

Thanks, dude.


: