The dyadic system function ŒTF returns the Transfer Form of the item whose name is its right argument. Alternatively it will decode any transfer form supplied as its right argument and return the name of the successfully decoded object. The transfer form of an object is a text representation of an APL variable, function or operator, suitable for transmission between dissimilar computer systems or implementations of APL. Two forms are allowed, the standard and extended forms. The standard form consists of a header portion and a data portion, with the header having the following format:
Name Description
Type Code 'F' for function 'N' for a numeric array 'C' for a character array Name Name of the object, followed by a blank Rank Character form of the rank of the object Shape Character form of the shape of the object followed by a blank Data Character form of the object
The standard transfer form cannot be used for mixed or nested variables or for user-defined operators.
The extended transfer form is a character string which, if executed, would reconstitute the item in question.
If the ŒTF function is unsuccessful, an empty vector is returned.
See also the )OUT and )IN system commands which will decode or create Transfer Forms for a list of objects.
SIMPLE„'TEXT STRING' (Sample data) MIXED„'ABC' (2 2½¼4) ’R„A FN B [1] R„A ÷ B [2] ’
Encoding items:
1 ŒTF 'SIMPLE' (Standard transfer form) CSIMPLE 1 11 TEXT STRING (Character, rank 1, shape 11) 1 ŒTF 'MIXED' (Standard transfer form won't work on mixed)
1 ŒTF 'FN' FFN 2 2 8 R„A FN BR„A÷B (Function called FN, rank 2, shape 2 8)
2 ŒTF 'SIMPLE' (Extended transfer form) SIMPLE„'TEXT STRING' 2 ŒTF 'MIXED' MIXED„('ABC') (2 2½1 2 3 4) 2 ŒTF 'FN' ŒFX 'R„A FN B' 'R„A÷B'
1 ŒTF 'ŒWA' (Similar format to encode system variables) NŒWA 0 740322 2 ŒTF 'ŒWA' ŒWA„740322 1 ŒTF 'ŒPW' NŒPW 0 80 2 ŒTF 'ŒTS' ŒTS„1990 5 31 0 36 52 734
Decoding objects:
TF1„1 ŒTF 'SIMPLE' TF2„2 ŒTF 'MIXED' )ERASE SIMPLE MIXED (Remove the original objects) )VARS TF1 TF2 1 ŒTF TF1 (Successful decode - name returned) SIMPLE )VARS SIMPLE TF1 TF2 (Object reappears) 1 ŒTF TF2 (Attempt to decode an extended version) (Empty vector and no object) )VARS SIMPLE TF1 TF2 2 ŒTF TF2 (Decode using the correct, extended form) MIXED