-
Notifications
You must be signed in to change notification settings - Fork 2
_tointernal
#tointernal
###Convert escape sequences in a string to their internal representations.
Syntax
result = tointernal string ;
Arguments
- str string
The str or list variable to convert,
Return Value
list result
- internalString : The converted list or string, with escape sequences converted to internal representation.
The STATUS variable is set to $ACKNOWLEDGE
When the argument is an array variable, all the elements in the array are converted, and the result will be a list array list result
- internalString : The converted list or string, with escape sequences converted to internal representation.
The STATUS variable is set to $ACKNOWLEDGE
When the argument is an array variable, all the elements in the array are converted, and the result will be a list array
Exceptions
-
%ARGUMENT: Invalid arguments. Usage: result = tointernal string ;
-
%BOUNDS: Subscript is out of bounds in tointernal()
Description
Escape sequences are required to insert special characters into strings. The tointernal() function converts the following escape sequences into their internal ASCII representations.
- \" - double quote, ASCII 34
- \' - single quote, ASCII 39
- \` - back quote, ASCII 96
- \a - bell, ctrl/g, ASCII 7
- \b - backspace, ASCII 8
- \f - form feed, ASCII 12
- \n - linefeed, ASCII 10
- \r - carriage return, ASCII 13
- \t - tab, ASCII 9
- \v - vertical tab, ASCII 11
- \nnn -octal value nnn
- \xnn - hex value 0xnn
The toexternal() functions converts the following internal ASCII values to the external forms:
- ASCII 7 converts to \a
- ASCII 8 converts to \b
- ASCII 12 converts to \f
- ASCII 10 converts to \n
- ASCII 13 converts to \r
- ASCII 11 converts to \v
- ASCII 34 converts to \"
- ASCII 124 converts to \174 (octal) (for messages only, encodes the pipe '|' character)
- all unprintable and nonwhitespace characters convert to \nnn (octal)
Examples
puts "Create an example for the function 'tointernal'" ;
Related Links
None