## FIELD

PURPOSE:
To assign values to fields of a templated string where the field names may not have been known at compile time.

    STATEMENT SYNTAX:
    {stno} FIELD tmpstr,str expr1 = {str expr2} or {num expr}

where:
tmpstr is the name of a string that was DIMed with a template.
str expr1 is the name of a field from the template
str expr2 or num expr is assigned to the field

    EXAMPLE:
    10 BEGIN
    20 DIM A$:"STR:C(10),NUMBER:D"
    30 LET A.STR$="1234567890"
    40 LET A.NUMBER=123.45
    50 PRINT A.STR$,A.NUMBER
    60 LET NAME1$="STR"
    70 LET NAME2$="NUMBER"
    80 FIELD A$,NAME1$="0987654321"
    90 FIELD A$,NAME2$=543.21
    100 PRINT A.STR$,A.NUMBER
    110 LET B1$=FIELD(A$,NAME1$)
    120 LET B2=NFIELD(A$,NAME2$)
    130 PRINT B1$,B2

NOTES:
The DEF function name must end in a '$' if the result to be return is a string.
SEE:
FIELD and NFIELD functions.
DIM statement