status = append ( destination , source ) ;
list destination
- Destination 'list' or 'str' variable.
list source
- Source data, any type.
str status
- $ACKNOWLEDGE
The data was appended.
The STATUS variable is set to $ACKNOWLEDGE
%ARGUMENT : Invalid arguments. Usage: status = append ( destination , source ) ;
%IDENTIFIER : 'variable' argument is not a valid identifier, literal, or reference
%INVALID : The destination is not a list or str variable.
The top-level source variable is appended to the end of the destination structure. The source variable becomes a member of the destination structure,and ceases to exist as a top-level variable.
The destination structure must be of type list or str .
Appending a variable into an empty list is equivalent to a direct assignment of the variable.
a = {} ;
append ( a, 1 ) ;
describe a ;
list 'a' = {
1
} ;b = 1 ;
describe b ;
list 'b' = {
1
} ;If you append a variable to a list, it ceases to be a top level variable. To recreate the variable, it the remove() or chop() function can bring it back.
a = { 1, 2.5, "abc" } ;
container = {} ;
append ( container, a ) ;
put exists a ;
0a = remove container ;
put exists a ;
1describe a ;
list 'a' = {
1,2.5,"abc"
} ;