11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ELSEELSEClause of block-oriented IF command.ELSE { code_block }Refer to IF command.DescriptionELSE is not a separate command, but a clause of the block-oriented IF command. Refer tothe IF command for details.Note:An earlier version of the ELSE command may exist in legacy applications where itis used with a line-oriented IF command. These commands may be recognizedbecause they do not use curly braces. The old and new forms of IF and ELSE aresyntactically different and should not be combined; therefore, an IF of one typeshould not be paired with an ELSE of the other type.The earlier line-oriented ELSE command could be abbreviated as E. The block-orientedELSE keyword cannot be abbreviated.The ELSE keyword must be followed by an opening and closing curly brace ({) and (}).Usually these curly braces enclose a block of code. However, an ELSE with no code blockis permissible, as in the following:SET x=1LoopIF x=1{WRITE "Once only"SET x=x+1GOTO Loop}ELSE{}WRITE !,"All done"There are no whitespace restrictions on the ELSE keyword.See Also• IF command• IF (legacy version) command• Flow Control Commands in Using <strong>Caché</strong> <strong>ObjectScript</strong><strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 37

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

Saved successfully!

Ooh no, something went wrong!