HP Data Entry and Forms Management System (VPLUS) Reference Manual (32209-90024)

Chapter 6 301
USING VPLUS INTRINSICS
INTRINSIC DESCRIPTIONS
variable
Variable within application, of type specified in VGETtype, into which
converted value is placed.
Discussion
If there is no ARB, all data is read from the unprotected fields on the screen as character
strings and concatenated to create a data buffer. The VGETBUFFER intrinsic copies the
entire buffer to an application program or VGETFIELD can be used to obtain the contents of
an individual field.
NOTE
If you are using VGETBUFFER in conjunction with an ARB, you do not need to
use VGETtype. VGETBUFFER performs all the required conversions on the
screen data in the buffer.
You can use both VGETBUFFER with an ARB and VGETtype calls in the same
program: the
buffercontrol
setting in the
comarea
that controls ARB
processing can be switched on or off for each form.
The VGETtype intrinsics, VGETINT, VGETDINT, VGETREAL, VGETLONG, VGETYYMMDD,
VGETPACKED, and VGETZONED, have been provided to perform conversion from character
coded data to the seven indicated data types. This intrinsic copies the contents of the field
identified by its field number from the data buffer. (Note that this field number is a unique
number assigned to each field by FORMSPEC and is totally independent of the field
position in the data buffer.) The field's value must be numeric, but its data type need not
be. That is, numbers in a character type field can be converted.
The numeric value, stored in the buffer in character coded form, is converted to the
specified type and then copied to the variable in the application. (Refer to Table 6-13. for
the format of each type.) If errors occur during conversion,
cstatus
is set to an error code.
If the requested field has an error, its value is moved to the variable, but
cstatus
is set to
an error code.
The default behavior for VGETPACKED and VGETZONED is to produce an unsigned result. If a
signed result is desired, the negative of the number of digits in the receiving variable
should be passed in the “numdigits” variable. For example, if the number of digits in the
receiving variables is 6, and a signed result is desired, then -6 should be placed in
“numdigits”.
Table 6-13. Numeric Type Conversions
Type Format
INT Two-byte word fixed-point; twos complement representation of positive and negative
values; range from -32768 through +32767.
DINT Four-byte word fixed-point format; twos complement representation of positive and
negative range between approximately -2 billion and +2 billion. (Not used by BASIC
programs.)
REAL Four-byte word floating-point format with sign bit in bit 0; an exponent (biased by +256) in
bits 1 through 9, and a positive fraction in the remaining 22 bits in HP 3000 format. (Not
used by COBOL programs.)