VPUTtype [ HP Data Entry and Forms Management System (VPLUS/V) ] MPE/iX 5.0 Documentation
HP Data Entry and Forms Management System (VPLUS/V)
VPUTtype
Copies a numeric value of specified type from an application to a field
in the data buffer in memory, converting the value to character set coded
external representation.
Syntax
VPUTtype {comarea,fieldnum,variable}
Parameters
type The type in VPUTtype indicates that this intrinsic may
be specified as:
VPUTINT converts value to two-byte integer
VPUTDINT converts value to four-byte integer
VPUTREAL converts value to four-byte real value
VPUTLONG converts value to eight-byte long value
*VPUTPACKED converts packed decimal format to
character set coded ASCII; this
intrinsic has two extra parameters,
numdigits and decplaces. Both are
two-byte integer variables that contain
the number of digits and number of
decimal places, respectively, specified
by the COBOL usage is comp-3 data
declaration.
*VPUTZONED converts zoned decimal format to
character set coded ASCII; has the
parameters numdigits and decplaces,
which are two-byte integer variables
that contain the number of digits and
number of decimal places, respectively,
specified by the COBOL data
declaration.
VPUTYYMMDD converts six-byte character value to
YMD, DMY or MYD
For example:
CALL "VPUTINT" USING COMAREA,FIELDNUM,VARIABLE
comarea Must be comarea name specified when the forms file was
opened with VOPENFORMF. If not already set, the
following comarea items must be set before calling
VPUTtype:
cstatus Set to zero.
comarealen Set to total number of two-byte words
in comarea.
VPUTtype may set the following comarea items:
cstatus Set to nonzero value if call
unsuccessful.
numerrs May be decremented if new value
replaces the value of a field with an
error.
fieldnum Two-byte integer variable containing the field number
assigned by FORMSPEC to the field in the data buffer to
which the value is copied.
variable Variable of specified type in an application that
contains the value to be converted to USASCII and copied
to a field in the data buffer.
Discussion
Depending on how it is specified, this intrinsic converts integer,
double, real, long, packed, zoned or yymmdd values to the external
representation and copies the converted value to a particular field in
the data buffer, right justified. (Note that the exact format depends on
the data type of the destination field.) The destination field is
identified by the field number assigned by FORMSPEC. The field to which
the value is copied may be defined as a numeric field (data type NUM[n],
IMPn, or DIG) or as a character field (data type CHAR).
NOTE If you are using VPUTBUFFER in conjunction with an ARB, you do not
need to use VPUTtype. VPUTBUFFER performs all the required
conversions on the application data in the buffer.
You can use both VPUTBUFFER with an ARB and VPUTtype calls in the
same program: the buffercontrol setting in the comarea that
controls ARB processing can be switched on or off for each form.
Note that the field number never changes as long as the field exists. It
is not changed when the position of the field in the form is changed, or
its length or other characteristics are changed. The field number can
only be changed with the batch command, RENUMBER, as described in Section
7. The field number should not be confused the screen order number,
which is the position of the field in the data buffer and is based on the
field position within the form. Thus, the field number provides a way to
locate fields regardless of their position.
If the specified field had an error, VPUTtype clears the field's error
flag, and decrements numerrs.
Refer back to Table 6-13 under VGETtype for the format of each of the
data types that may be converted. Note that COBOL does not have type
real or long, and BASIC does not have a double integer data type.
Example
COBOL
77 FIELD-NUM PIC S9(4) COMP.
77 ITEM PIC S9(4) COMP.
:
MOVE 4 TO FIELD-NUM.
MOVE 25 TO ITEM.
CALL "VPUTINT" USING COMAREA, FIELD-NUM, ITEM.
BASIC
260 F1=4
263 I=25
265 CALL VPUTINT(C(*),F1,I)
FORTRAN
FIELD=4
ITEM=25
CALL VPUTINT(COMAREA,FIELD,ITEM)
SPL/PASCAL
INTEGER FIELD,ITEM;
:
FIELD:=4;
ITEM:=25;
VPUTINT(COMAREA,FIELD,ITEM);
The calls shown above convert an integer value of 25 in the application
to the external representation and copy it to field 4 in the data buffer
in memory.
MPE/iX 5.0 Documentation