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.

Legacy Commands and FunctionsCode Block SyntaxPeriods used to indicate the lines belonging to a code block take the following syntax:• The argumentless DO command should be the last command on its code line. It may befollowed, after one or more whitespace characters, by a comment indicator character (;or //) on the same line.• The code line immediately following the argumentless DO command, and every linewithin the block of code must have a period prefix, even if it is a comment line or a blankline.• The periods must prefix the code line. Therefore, no commands or comments may appearbefore the periods or between the periods on a code line.• The period must be indented. That is, it cannot be in the first column of the code line.Usually, the initial period is indented to the same level as the code line containing theargumentless DO command.• Nested code blocks mark each level of nesting by using additional prefix periods. Toindicate nesting, place the first period at the level of the code line containing the outermostDO, and indent with additional periods for each additional level of nesting.• A code block cannot contain labels. It can contain comment lines and blank lines, butthese lines must be prefixed by a period, following the same rules as code lines.• A period must be followed by at least one whitespace character (a blank space or tab).• This space character must be followed by either a command keyword, another prefixperiod (.), a comment indicator (; or //), or a line return. Therefore, line breaks within acommand should not be used with this syntax.• Period prefix code blocks should not be combined with code blocks delineated by curlybraces.NestingPeriod prefix code blocks can be nested within each other. Because the lines belonging to agiven code block all have the same number of prefix periods, you can easily visually distinguishthe contents of each block.When viewed in a listing, the lines in nested code blocks appear indented relative to eachother. For example, the lines in an inner block contain one more prefix period character thanthe lines in the outer block that contains it.742 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!