PACK
Creates a packed string made up of any number of strings of varying lengths.
Type
String function
Format
PACK(flag 'string1'...'stringn') - flag
- A boolean value that controls how imbedded packed strings are
processed:
- 0
- Packed strings are treated as normal character strings.
- 1
- Any packed strings found in string1, etc., are unpacked, then repacked as if the substrings were passed separately.
- string1...stringn
- The source text strings.
Usage Notes®
- PACK allows you to build a string that is made up of any number of variable length strings.
- PACK allows you to pass data from one dialog to another in a single string.
- Set flag to 1 (true) to iteratively build a packed string if you do not know all of the pieces at once. See "Example."
- When you refer to a packed string, enclose it in quotes. Otherwise it is tokenized and the control information is lost.
- The packed string can be split again using the UNPACK function.
Example
Use the following example to set
up a parameter list of four entries:
set Parm (pack(0 &Val1 &Val2 'Const Char' &Val4))To
append more strings to Parm, use:
set Parm (pack(1 '&Parm' &Addl1 'More Data' &Val6))