Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see Why Migrate to InterSystems IRIS?

Routine Line Syntax

We've already talked about the syntax of an ObjectScript line containing one or more commands. When writing a routine, however, there are a couple of additional considerations. A line in a routine can have a label at the beginning (also called a tag), ObjectScript code, and a comment at the end; but all of these elements are optional.

If a line has a label, you must separate it from the rest of the line with a tab. This means that as you add lines to your routine using Studio, you either type a label and a tab, followed by ObjectScript code, or you skip the label and type a tab, followed by ObjectScript. So in either case, every line must have a tab before the first command. If the line only contains comments, there must be a tab before the comment.

Studio also allows you to type a space instead of a tab before the first command. If you use a space, the commands and comment-only lines won't line up like they do in the example below when first entered.

hello ; hello world routine
    write !, "hello world"
    write !, "bye"
end quit  ; end
Feedback