_tadd.utl Utility - Add New Field to Template
Syntax
call "_tadd.utl",base_template$,new_string$,$$,{change_only_existing}
call "_tadd.utl",base_string,$$,fieldname$,0,field_type$,
field_length{,set_variable_length}
Description
The _tadd.utl utility adds a new field, or series of fields, to the string template of a character variable without losing any existing information.
Parameter |
Description |
base_template$ |
Base template to be modified. |
new_string$ |
New field or fields to add to base_template$. If a template is associated with this string, do not use fieldname$, field_type$, length, or variable. |
fieldname$ |
Fieldname to be added to base_template$. |
change |
If set to 1, this only changes fields that exist in both base_template$ and new_string$. |
field_type$ |
Data type of new_string$ (C, N, I, U, F, D). |
field_length |
Field length of new_string$. |
set_variable_length |
If the field is variable length, use 1. If the field is not variable length, use 0. For example, variable length fields generate a template of "C(20*)" as opposed to "C(20)". |
Example
The following dimensions T$ with a one-field template, then adds two additional fields:
CALL BBEXT$+"_tadd.utl",T$,$$,"cust",0,"C",8
DIM NEW$:"ADDR:C(25*),ZIP:C(9*)"
CALL BBEXT$+"_tadd.utl",T$,NEW$
T$ is now dimensioned to:
"CUST:C(8),ADDR:C(25*),ZIP:C(9*)".