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.

<strong>Caché</strong> <strong>ObjectScript</strong> CommandsThe variable argument receives the input characters. READ first defines variable, if it isundefined, or clears it if it has a previous value. Therefore, if no data is input for variable(for example, if the READ times out before any characters are entered) variable is definedand contains the null string. This is also true if the only character entered is a terminatorcharacter (for example, pressing the key from the user terminal). For the effects ofan interrupt (for example, ) see below.Note that for fixed-length and variable-length reads, variable does not store the terminatorcharacter used to terminate the read operation. Single-character reads handle variable differently;for single-character read use of variable, see below.If a READ times out, those characters input before the timeout are stored in variable, eventhough the data was not entered by a terminator character, such as the key.There are three types of READ operations: variable-length read, fixed-length read, and singlecharacterread. All of these can be specified with or without a timeout argument. A singleREAD command can include multiple READ operations in any combination of these threetypes. Each read operation is executed independently in left-to-right sequence. A READcommand can also contain any number of string and format arguments.The three types of READ operations are as follows:• A variable-length read has the following format:READ variableA variable-length read accepts any number of input characters and stores them in thespecified variable. Input is concluded by a terminator character. For a terminal, this terminatoris usually supplied by pressing the key. The input characters, but notthe terminator character, are stored in variable.• A fixed-length read has the following format:READ variable#nA fixed-length read accepts a maximum of n input characters and stores them in thespecified variable. Input concludes automatically when the nth character is input, or whena terminator character is encountered. For example, entering two characters in a fourcharacterfix-length read, and then pressing the key. The input characters, butnot the terminator character (if any), are stored in variable.• A single-character read has the following format:READ *variable116 <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!