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.

<strong>Caché</strong> <strong>ObjectScript</strong> CommandsMnemonic/IC(n)/DC(n)/EC(n)DescriptionInserts spaces for n characters at the current cursor location, movingthe rest of the line to the rightDeletes n characters to the right of the cursor and collapses the lineErases n characters to the right of the cursor, leaving blanks in theirsteadFor further details on mnemonics, see the <strong>Caché</strong> I/O Device Guide.Specifying a Sequence of Format Controls<strong>Caché</strong> allows you to specify a sequence of format controls and to intersperse format controlsand expressions. When specifying a sequence of format controls it is not necessary to includethe comma separator between them (though commas are permitted.) A comma separator isrequired to separate format controls from expressions.In the following example, the WRITE command advances the output by two lines and positionsthe first output character at the column location established by the input for the READcommand.READ !,"Enter the number: ",numSET col=$XSET ans=num*num*numWRITE !!,"Its cube is: ",?col,ansThus, the output column varies depending on the number of characters input for the READ.Escape Sequences with WRITEThe WRITE command, like the READ command, provides support for escape sequences.Escape sequences are typically used in format and control operations. Their interpretation isspecific to the current device type.To output an escape sequence, use the form:WRITE *27,"char"where *27 is the ASCII code for the escape character, and char is a literal string consistingof one or more control characters. The enclosing double quotes are required.For example, if the current device is a VT-100 compatible terminal, the following commanderases all characters from the current cursor position to the end of the line.WRITE *27,"[2J"168 <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!