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> CommandsReading Non-Printing CharactersNon-printing characters are characters outside the standard range of ASCII printable characters.In other words, they are characters whose ASCII codes are less than ASCII 32 or greater thanASCII 127. They are characters that have no single key equivalents on a standard keyboard.The characters whose codes are less than ASCII 32 are usually used for control operations.They can be entered only in conjunction with the CTRL key. For example, ETX (ASCII 3)is entered as and is used to assert a BREAK when entered from the keyboard.The characters whose codes are greater than ASCII 127 are usually used for graphics operations.As a rule, they cannot be entered from the keyboard, but they can be read from othertypes of devices. For example, ASCII 179 produces the vertical line character.You can use the READ command to input non-printing characters as well as the standardASCII printable characters. However, you must include code to handle the escape sequenceused for each such character. An escape sequence is a sequence of characters that starts withthe ESC character (ASCII 27). For example, you can code a READ so that the user is allowedto press a function key as a valid input response. Pressing the function key produces an escapesequence that can be different for different types of terminals.<strong>Caché</strong> <strong>ObjectScript</strong> supports input of escape sequences by storing them in the $ZB and $KEYspecial variables, rather than in the specified variable. For example, for a function key press,<strong>Caché</strong> stores the ESC code (ASCII 27) in $ZB and $KEY. To handle an escape sequence,you must include code that tests the current value in $ZB or $KEY after each READ becausesubsequent reads update these special variables and overwrite any previous value. ($ZB and$KEY are very similar, but not identical; see $KEY for details.) To display a non-printingcharacter, such as an escape sequence, use the ZZDUMP command or the $ASCII function.Sequential File End-of-FileThe behavior of READ when encountering an end-of-file for a sequential file depends onthe system-wide default. Go to the System Management Portal, select System Configuration,select Advanced Settings, on the pull-down Category list select <strong>ObjectScript</strong>. View and editthe current setting of SetZEOF. This option controls the behavior when <strong>Caché</strong> encounters anunexpected end-of-file when reading a sequential file. When set to “true” , <strong>Caché</strong> sets the$ZEOF special variable to indicate that you have reached the end of the file. When set to“false” , <strong>Caché</strong> issues an error. The default is “false” .Setting $ZUTIL(69,40) overrides this default system-wide; it does not change the SystemConfiguration setting. Setting $ZUTIL(68,40) overrides the system-wide setting for thecurrent process.124 <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!