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

Chapter 6 303
USING VPLUS INTRINSICS
INTRINSIC DESCRIPTIONS
status word.
6. VGETINT and VGETDINT only convert the integer portion of a given field. The fractional
portion is truncated before conversion. Remember that in a field of type IMPn, the
rightmost "n" characters are treated as a fraction.
7. Note that if VGETFIELD is used to pass a field containing a decimal point to a COBOL
program, the decimal point is also passed and no arithmetic may be performed on the
field.
8. Negative numbers can be zoned correctly for COBOL only by using the VGETINT and
VGETDINT intrinsics. VGETBUFFER and VGETFIELD transfer the negative sign, but
COBOL treats the value as positive, ignoring the sign character. An EXAMINE statement
using TALLY can determine that the negative sign is present and then the program can
treat the value accordingly.
9. Normal rules of truncation in COBOL are followed. For example, conversion of 12345
using VGETINT with a receiving field of S9(4) truncates to the value of 2345.
10.VGETINT may be used to convert positive integers to type LOGICAL in SPL.
Example
COBOL
77 FIELD-NUM PIC S9(4)COMP.
77 COUNT PIC S9(4)COMP.
:
MOVE 5 TO FIELD-NUM
CALL "VGETINT" USING COMAREA, FIELD-NUM, COUNT.
BASIC
210 F1=5
220 CALL VGETINT(Cl(*),F1,C)
FORTRAN
FIELD=5
CALL VGETINT(COMAREA,FIELD,K1)
SPL/PASCAL
INTEGER
FIELD,
COUNT;
:
FIELD:=5;
VGETINT(COMAREA,FIELD,COUNT);
The calls in this example convert a value contained in field 5 in the data buffer to two-byte
integer representation and store it in an application.