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> Special VariablesIf the user types 123 at the READ prompt and presses , <strong>Caché</strong> stores 123 in thenum variable and stores (ASCII decimal code 13, hexadecimal 0D) in $ZB. Ifthe READ times out, $ZB contains the null string; $ASCII("") returns a value of –1.$ZB on the Command LineWhen issuing commands interactively from the <strong>Caché</strong> Terminal command line, you press to issue each command line. The $ZB and $KEY special variables record thiscommand line terminator character. Therefore, when using $ZB or $KEY to return the terminationstatus of a read operation, you must set a variable as part of the same command line.For example, if you issue the command:>READ x:10from the command line, then check $ZB it will not contain the results of the read operation;it will contain the character that executed the command line. To return the resultsof the read operation, set a local variable with $ZB in the same command line, as follows:>READ x:10 SET rzb=$ZBThis preserves the value of $ZB set by the read operation. To display this read operationvalue, issue either of the following command line statements:>WRITE $ASCII(rzb); returns -1 for null string (time out),; returns ASCII decimal value for terminator character>ZZDUMP rkey; returns blank line for null string (time out); returns hexadecimal value for terminator character$ZB with Magnetic Tape I/O$ZB contains status information about the driver buffer. Specifically, it contains the numberof bytes that remain in the magnetic tape drive's internal buffer.Immediately after you read a block, <strong>Caché</strong> sets $ZB to that block's size. As you transferlogical records from the buffer to variables (with READ commands), <strong>Caché</strong> decrements the$ZB value until it reaches 0 and the next block read occurs.When you write to tape, $ZB shows the available space (in bytes) remaining in the driver'sinternal buffer. Immediately after you write a block, <strong>Caché</strong> sets $ZB to the buffer size specifiedwith the OPEN command. As you transfer logical records from <strong>Caché</strong> variables into thebuffer (with WRITE commands), <strong>Caché</strong> decrements the $ZB number until it reaches 0 andthe block write occurs.464 <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!