LET FMD
Store String Value into Format's Data Area
This directive stores a string’s value into the data area of a format currently in memory.
Syntax
Section titled “Syntax”LET FMD(string-value[, element-number[, occurrence-number]] ) = data-val [,ERR=line-ref|,ERC=error-code]string-value- is any string that contains a format name or data name.
element-number- is a positive integer that specifies the data element to be referenced. The element-number must be 0 if a data name is specified.
occurrence-number- is a positive integer that specifies the occurrence of a data element.
data-val- is any string that represents a format's data area or a portion of a format's data area.
line-ref- is the program line number or label to branch to if an error is produced
error-code- is a programmer-defined error code. Valid values are positive or negative whole numbers.
Remarks
Section titled “Remarks”The capability of specifying a data name is generally available starting with release 8.3.0.
Starting with release 8.2.2, specifying a zero for the occurrence-value of a data element defined to have multiple occurrences will assign data-val to all occurrences of the data element.
An attempt to reference an invalid format/data name results in an ERR=17.
An attempt to reference a data name with a data element number results in an ERR=17.
An attempt to reference a format name that the data dictionary or current program does not recognize results in an ERR=161.
An attempt to reference a data name that does not exist in the format’s data element table, either by name or element number, results in an ERR=163.
An attempt to reference an occurrence number of an element that is defined to not have multiple occurrences results in an ERR=164.
An attempt to reference an invalid occurrence number of an element that is defined to have multiple occurrences results in an ERR=165.
Examples
Section titled “Examples”F$ = "#DNFFMT"LET FMD(F$)=D$stores the value of D$ into format #DNFFMT’s data area.
LET FMD(F$,2) = X$stores the value of X$ into the second data element defined in the format #DNFFMT.
LET FMD (F$,3,4) =Y$stores the value of Y$ into the fourth occurrence of the third data element defined in format #DNFFMT.
LET FMD(F$,3,0)=Z$stores the value of Z$ in all occurrences of the third data element defined in format #DNFFNMT.
LET FMD(F$+"."+ATR(F$,3,21),3,0)=Z$produces the same results as the previous example.
See also
Section titled “See also”ATR, FMD, FMT functions FORMAT INCLUDE, FORMAT INIT, FORMAT DEFAULT, and FORMAT DELETE directives
From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF