LINK Command [ HP ALLBASE/4GL Developer Reference Manual Vol. 2 ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Reference Manual Vol. 2
LINK Command
The LINK command concatenates a number of fields, and optionally
separates them with a common literal.
Formats
LINK [*JOINER=joiner] link_count link_data_ref ...result_data_ref
Window
Parameters
link_count
A number greater than or equal to 2 that specifies the number of fields
to be linked together.
link_data_ref
The fields to be concatenated, each of which can be one of the following:
* A literal.
* A numeric or alphanumeric constant.
* A variable or calculated item.
* A master title name.
* A screen field reference.
* A scratch-pad field reference.
* A file record field reference.
* A work area field reference.
* A communication area field.
result_data_ref
The field where the result of the link is placed. It can be one of the
following:
* A variable.
* A screen field reference.
* A scratch-pad field reference.
* A file record field reference.
* A work area field reference.
* The communication area field *PASS.
joiner
The data used to separate each of the link fields. The joiner is
optional, but if you specify it, you must precede it with the argument
*JOINER=.
Enter the joiner into the Joiner field on the window.
The joiner can be one of the following:
* A literal.
* A numeric or alphanumeric constant.
* A variable or calculated item.
* A master title name.
* A screen field reference.
* A scratch-pad field reference.
* A file record field reference.
* A work area field reference.
* A communication area field.
Description
The LINK command concatenates (links or joins together) specified fields.
Use the LINKLOOP command to concatenate a series of fields.
You can specify an optional separator or joiner which is placed between
each of the concatenated fields.
You must specify the count of the number of fields being concatenated.
If you're using the window, HP ALLBASE/4GL supplies this count
automatically and places it into the appropriate position in the command.
The LINK command links each link_data_ref without any modification. That
is, blanks (if any) are not removed during the concatenation process into
the result_data_ref.
The optional joiner, if specified, separates each link_data_ref in the
result_data_ref field. If you specify a joiner, it must be immediately
preceded by the command argument *JOINER=.
Example 1
LINK 2 V-P_Number S-Opt_Number.Opt_Lst *PASS
FILE *READ option *KEY=*PASS
This command links the contents of the variable P_Number with the
contents of the field Opt_Number on the screen Opt_Lst and places the
result in the communications area field *PASS. The FILE command then uses
this result as a key to access the file option.
Example 2
LINK *JOINER = "/" 3 * *+1 *+2 F-date.stock
This command concatenates the current and the next two screen fields.
The command separates each field by a slash and places the result into
the field date on the file stock. This operation could be picking up
three fields on the screen, representing the month, day, and year,
formatting them as a date and then saving the date in the file buffer.
MPE/iX 5.0 Documentation