At 06:18 PM 8/14/2013, Dan Goldberg wrote:
Is it okay to use goto statements inside of while loops?
The reason I am asking is I am having one inside a form eep which kills
the eep when it runs that line.
Dan,
Never use GOTO to exit from a WHILE loop; use BREAK instead. BREAK clears
the WHILE loop. When you do not use BREAK or the naturally occurring exit
(that is, when the WHILE loop conditions are no longer true) to exit from
a WHILE loop, R:BASE continues to read commands into memory. If you have
a large command or procedure file, you can run out of memory and your
program terminates abnormally.
Technically, to exit from a WHILE loop before the WHILE condition becomes
false, use an IF...ENDIF structure to check other conditions, then use the
BREAK to exit from the WHILE loop.
The BREAK command causes the WHILE loop to terminate when the conditions
specified in the IF statement become true.
Hope that helps!
Very Best R:egards,
Razzak.
www.rbase.com
www.facebook.com/rbase
--
30+ years of continuous innovation!
15 Years of R:BASE Technologies, Inc. making R:BASE what it is today!
--