encode <ident> {,<message> ... }
Write a list of values to a string identifier.
<ident>
The receiving string identifier. This may or may not already exist.
<message>
One or more values in the form of an output list.
-del=<string>
Use <string>,
a string value, as the delimiter between output fields. By default a single
space is used.
-fmt=<string>
Use <string>
as a format specification for output field conversion. The rules for the
format string are those for C language "printf" statements,
although conversion types %c %n %p are not handled. If no format switch
is supplied, then fields are output with appropriate delimitation (using
the value from -del).
-q
When this switch is present, output values of string identifiers (only) are enclosed within double
quotes.
If there are no output list items, no action will be taken.
If <ident> does not exist it will be created using current scope rules.
Each output list grouping will create one element in <ident>, thus multiple output items will treat <ident> as a string array.
Create a 3-element string array.
encode s, 'A','B','C'
Create a single string identifier containing 'A,B,C'.
encode s, <'A','B','C'>, -del=','
Create a single string identifier with formatted numeric values.
numeric x,y,z encode s, <x,y,z>, -fmt="%8.2f %g %10.4e"
Create a string identifier containing the hexadecimal value of a numeric identifier (integerised).
numeric x = 28 encode s, x, -fmt='%0x'
Commands: |