lrt_Fadd_fld

Buffer Manipulation Functions

Adds a new field to an FML buffer. An FML or FML32 buffer is a string in the form "name=<NAME>" or "id=<ID>".

int lrt_Fadd_fld( FBFR *fbfr, "name=fldname" | "id=idval", "value=fldvalue" [, "len=8"], LRT_END_OF_PARAMS );

fbfr A pointer to the FML or FML32 buffer.
fldname Field name.
idval Field identifier.
fldvalue Value of the new FML field.
len Field length.

The list of parameters must end with LRT_END_OF_PARAMS.

The lrt_Fadd_fld function adds a new field to an FML Buffer - FML32 Buffer. Either the name of the FML field or its field id must me specified as the second parameter. The value of the new field must be specified in the third parameter. The field length is optional. It only needs to be specified if the type of FML field is CARRAY (binary data). The length of the other field is determined by field type and value.

Important: If the data is CARRAY, then once you save the parameter, the len argument becomes the length of the parameter name, rather than the length of the recorded value. For example, if the parameter is <parm>, then len will be 6.

Return Values

If the function succeeds, it returns the field id (FLDID) of the new field.

Parameterization

The following argument(s) can be parameterized using standard parameterization: name=fldname, id=idval, value=fldvalue, len=8. Note that you can parameterize only the section after the = sign (e.g., for name=fldname, fldname can be parameterized and name cannot).

Example

In the following example, lrt_Fadd_fld adds a new field 8302. the value is 1000, and length is 4. The example for lrt_Fadd32_fld is identical except for the function name.

Copy code
/* add a field with id 8302*/
lrt_Fadd_fld( (fbfr*)data_0, "id=8302", "value=1000", "len=4", LRT_END_OF_PARAMS);