Previous Application Programming: Strings Next

Non-Printing Characters

ASCII characters with value less than 32 or greater than 126 do not have printable representations. Such characters can be included in string constants by specifying their ASCII value as a byte argument to the STRING function.

For example, to represent the TAB character, use the expression

STRING(9B)  

This syntax can be used when comparing strings or performing regular expression matching. For example, to find the position of the first TAB character in a string:

pos = STREGEX(input_string, STRING(9b))  

where input_string is a variable containing the string to be searched.

The following table lists the some ASCII characters you might commonly want to represent as IDL strings.

Table 14-3: Selected ASCII Characters
and Their Byte Values 

Table 14-3: Selected ASCII Characters
and Their Byte Values 
ASCII Character
Byte Value
Bell
7B
Backspace
8B
Horizontal Tab
9B
Linefeed
10B
Vertical Tab
11B
Formfeed
12B
Carriage Return
13B
Escape
27B

For a complete list, consult a standard ASCII table.


Note
ASCII characters may have different effects (or no effect) on platforms that do not support ASCII terminal commands.

  IDL Online Help (March 06, 2007)