MOVE Command [ HP ALLBASE/4GL Developer Reference Manual Vol. 2 ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Reference Manual Vol. 2
MOVE Command
The MOVE command copies the contents of a field to another field.
Format
MOVE {from_data_ref} to_data_ref
{*NULL }
Parameters
from_data_ref
The field containing the data to be copied. It can be any of the
following:
* Literal.
* Master title name.
* Numeric or alphanumeric constant.
* Variable or calculated item.
* Screen field reference.
* Scratch-pad field reference.
* File record field reference.
* Work area field reference.
* Communication area field.
* File record buffer.
* Work area buffer.
In the MOVE command, you can specify a screen field by the field name and
optionally omit the screen name.
to_data_ref
The field to which the data is to be copied. It can be any of the
following:
* Variable.
* Screen field reference.
* Scratch-pad field reference.
* File record field reference.
* Work area field reference.
* Alterable communication area field.
* File record buffer.
* Work area buffer.
Description
The MOVE command copies the contents of one field to another field. The
contents of the originating field remain unchanged. The previous
contents of the receiving field are overwritten.
If you use the MOVE command to copy the contents of one field to another,
and the to_data_ref field is longer than the from_data_ref field, the
extra space in the to_data_ref field is filled with the pad character.
If you use the MOVE command to copy the contents of one buffer to another
buffer, and the to_data_ref is longer than the from_data_ref, HP
ALLBASE/4GL fills the remaining fields in the destination buffer with
spaces.
If the to_data_ref buffer or field is shorter than the from_data_ref
buffer or field, HP ALLBASE/4GL will truncate the data.
The MOVE *NULL form of the command sets the indicator variable associated
with a select list field or an SQL table field to the null value setting,
and fills the field with pad characters. You can only use this form of
the MOVE command if the to_data_ref is a select list record field or an
SQL table record field. Null value status is not preserved if you use
the MOVE command to copy the contents of one buffer to another.
If you specify a file record buffer or a work area buffer as either the
from_data_ref or the to_data_ref you cannot use substring references.
Example 1
MOVE *S01 F-item_no.stock
This command moves the contents of screen field number 1 to the field
item_no on the file stock.
Example 2
MOVE *DATE[4,2] V-month
This command moves the current month from the communication area field
*DATE to the variable month.
Example 3
MOVE B-build_rec R-outfile
This command moves the entire contents of the work area buffer build_rec
to the default record buffer for the file outfile.
MPE/iX 5.0 Documentation