11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

a range with initial value, increment, and no limit. Breaks occur when x has the initial values1, 20, and 50.USER>ZBREAK *xUSER>FOR x=1:1:10,20,50:2 {SET t=x QUIT:x>69}USER 2f0>WRITEx=1USER 2f0>gUSER>FOR x=1:1:10,20,50:2 {SET t=x QUIT:x>69}USER 2f0>WRITEt=10x=20USER> 2f0>gUSER>FOR x=1:1:10,20,50:2 {SET t=x QUIT:x>69}USER 2f0>WRITEt=20x=50USER 2f0>gUSER>WRITEt=70x=70Terminating a FOR Loop with QUIT or GOTOA FOR loop is terminated by a QUIT only if the QUIT appears within the code block. If<strong>Caché</strong> encounters a QUIT in a subroutine called by the DO command, it terminates only thesubroutine, not the FOR loop itself.A FOR loop is terminated by a GOTO that transfers control outside of its code block. AFOR loop is not terminated by a GOTO that transfers control within its code block. If aGOTO exits from a subroutine called by the DO command, <strong>Caché</strong> exits only the DO command,not the FOR loop.See Also• FOR (legacy version) command• DO WHILE command• WHILE command• IF command• GOTO command• DO command• QUIT commandFOR<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 45

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!