HPlogo HP Data Entry and Forms Management System (VPLUS) Reference Manual: HP 3000 MPE/iX Computer Systems > Appendix J HP PRECISION ARCHITECTURE

HPPA INTRINSICS

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Introduction

On the MPE/V and previous systems, Hewlett Packard represented real or floating point numbers in a format unique to each machine. However, on the MPE/XL systems, these numbers are represented in a format that conforms with an IEEE standard. This means that programs running in native mode on MPE/XL systems will deal with numbers stored in the IEEE format. VPLUS will be running in compatibility mode, however, and will thus deal with numbers stored in the MPE/V format.

Currently, VPLUS offers intrinsics that will accept a real number n the MPE/V format, convert it to its equivalent external representation and put it into a form's data buffer. The four HPPA intrinsics described below have been developed to allow programs running in native mode to perform the same operations on a number stored in the IEEE format.

NOTE: Use these intrinsics only if you are programming entirely in native mode. If you are accessing a database in compatibility mode, you must use the VPLUS intrinsics, VGET/PUTtype.

VGETIEEEREAL

Copies character coded data contents from data buffer into an application, converting numeric value to IEEE floating point format.

Syntax
VGETIEEEREAL {comarea,fieldnum,variable}
Parameters
comarea

Must be the comarea name specified when the forms file was opened with VOPENFORMF. If not already set, the following comarea items must be set before calling VGETIEEEREAL:

cstatus

Set to zero.

comarealen

Set to total number of two-byte words in comarea.

VGETIEEEREAL may set the following comarea items:

cstatus

Set to nonzero value if call is unsuccessful or if requested field has an error.

fieldnum

Two byte integer variable containing the number assigned to the field by FORMSPEC. The field itself may not be longer than 80 characters.

variable

Variable within application, of type IEEE floating point real (32 bits), into which converted value is placed.

For Example:

VGETIEEEREAL(COMAREA,FIELDNUM,VARIABLE);
Discussion

The content of the field denoted by the field number is read from the data buffer. This content must be numeric but its data type need not be; numbers in a field of CHAR type can be converted.

NOTE: The field number is a unique number assigned to each field by FORMSPEC and is completely independent of the field's position in the data buffer or the form. It only changes if the batch command, RENUMBER, is used. You can alter the length, position or other characteristics of a field without affecting the field number. The field number provides a way to locate fields regardless of their position.

The numeric value, stored in the buffer in character coded form, is converted to IEEE floating point format and then copied to the variable in the application. If errors occur during conversion, cstatus is set to the appropriate error code. If the requested field's error code is set, its value is moved to the variable but cstatus is set to an error code.

VGETIEEELONG

Copies character coded data contents from data buffer into an application, converting numeric value to IEEE floating point long format (64-bit).

Syntax
VGETIEEELONG {comarea,fieldnum,variable}
Parameters
comarea

Must be the comarea name specified when the forms file was opened with VOPENFORMF. If not already set, the following comarea items must be set before calling VGETIEEELONG:

cstatus

Set to zero.

comarealen

Set to total number of two-byte words in comarea

VGETIEEELONG may set the following comarea items:

cstatus

Set to nonzero value if call is unsuccessful or if requested field has an error.

fieldnum

Two-byte integer variable containing the number assigned to the field by FORMSPEC. The field itself may not be longer than 80 characters.

variable

Variable within application, of type IEEE floating point (64 bits), into which converted value is placed.

For example:

VGETIEEELONG(COMAREA,FIELDNUM,VARIABLE);
Discussion

The content of the field denoted by the field number is read from the data buffer. The content of the field must be numeric, but its data type need not be; numbers in a field of CHAR type can be converted.

NOTE: The field number is a unique number assigned to each field by FORMSPEC and is completely independent of the field's position in the data buffer or the form. It only changes if the batch command, RENUMBER, is used. You can alter the length, position or other characteristics of a field without affecting the field number. The field number provides a way to locate fields regardless of their position.

The numeric value, stored in the buffer in character coded form, is converted to IEEE floating point long format and then copied to the variable in the application. If errors occur during conversion, cstatus is set to the appropriate error code. If the requested field's error code is set, its value is moved to the variable but cstatus is set to an error code.

VPUTIEEEREAL

Writes a floating point number in IEEE standard format from an application to a specified field in the form data buffer, converting the value to character set coded external representation.

Syntax
VPUTIEEEREAL {comarea,fieldnum,variable}
Parameters
comarea

Must be the comarea name specified when the forms file was opened with VOPENFORMF. If not already set, the following comarea items must be set before calling VPUTIEEEREAL:

cstatus

Set to zero.

comarealen

Set to total number of two-byte words in comarea.

VPUTIEEEREAL may set the following comarea items:

Title not available (Parameters )

cstatus

Set to nonzero value if call is unsuccessful.

numerrs

May be decremented if a new value replaces the old value of a field with an error.

fieldnum

Two-byte integer variable containing the number assigned by FORMSPEC to the field in which the value is written. The field itself may not be longer than 80 characters.

variable

Variable within application, of type IEEE floating point real (32 bits), that contains the value to be converted to character set coded external representation and copied to a field in the data buffer.

For example:

VPUTIEEEREAL(COMAREA,FIELDNUM,VARIABLE);
Discussion

This intrinsic converts an IEEE floating point real number to its character coded form and writes the converted value to a particular field in the data buffer, right justified. The exact format of the written data depends on the type of destination field. For example, if the number "34.56" were put to a field of type DIG, the result would be "34" since such a field may contain only the digits 0 through 9. The destination field is identified by the field number assigned by FORMSPEC, and must be defined as a numeric field, that is, type NUM, IMP or DIG.

If the specified field had an error, VPUTIEEREAL will clear the field's error flag and decrement numerrs.

NOTE: The field number is a unique number assigned to each field by FORMSPEC and is completely independent of the field's position in the data buffer or the form. It only changes if the batch command, RENUMBER, is used. You can alter the length, position or other characteristics of a field without affecting the field number. The field number provides a way to locate fields regardless of their position.

VPUTIEEELONG

Writes a floating point number in IEEE standard long format from an application to a specified field in the form data buffer, converting the value to character set coded external representation.

Syntax
VPUTIEEELONG {comarea,fieldnum,variable}
Parameters
comarea

Must be the comarea name specified when the forms file was opened with VOPENFORMMF. If not already set, the following comarea items must be set before calling VPUTIEEELONG:

cstatus

Set to zero.

comarealen

Set to total number of two-byte words in comarea.

VPUTIEEELONG may set the following comarea items:

cstatus

Set to nonzero value if call is unsuccessful.

numerrs

May be decremented if a new value replaces the old value of a field with an error.

fieldnum

Two-byte integer variable containing the number assigned by FORMSPEC to the field to which the value is written. The field itself may not be longer than 80 characters.

variable

Variable within application, of type IEEE floating point long (64 bits), that contains the value to be converted to character set coded external representation and copied to a field in the data buffer.

For example:

VPUTIEEELONG(COMAREA,FIELDNUM,VARIABLE);
Discussion

This intrinsic converts an IEEE floating point long number to its character coded form and writes the converted value to a particular field in the data buffer, right justified. The exact format of the written data depends on the type of the destination field. For example, if the number "34.56" were put to a field of type DIG, the result would be "34" since such a field may contain only the digits 0 through 9. The destination field is identified by the field number assigned by FORMSPEC, and must be defined as a numeric field, that is, NUM,IMP or DIG.

If the specified field had an error, VPUTIEEELONG will clear the field's error flag and decrement nuerrs.

NOTE: The field number is a unique number assigned to each field by FORMSPEC and is completely independent of the field's position in the data buffer or the form. It only changes if the batch command, , is used. You can alter the length, position or other characteristics of a field without affecting the field number. The field number provides a way to locate fields regardless of their position.

THE HP32209S UTILITY

The HP322095 utility provides you with a simple way to confirm the versions of both the native mode software and the compatibility mode software that you are currently running on the system. HP322095 resides in the PUB.SYS group and account. You can use it by typing the MPE command.

:RUN HP32209S.PUB.SYS

The screen will display the product name and version as well as the version number of each segment of the software. This is to indicate any patches that may have a version number different from the product.

This is a quick way to test whether native mode is moving through to compatibility mode on the MPE/XL system, and hence to confirm that the VPLUS software is accessible in compatibility mode.

Example

When you run HP32209S, the screen displays the information in the format shown in the following example, first for native mode and then for compatibility mode. In this example, VPLUS native mode is enabled and the VPLUS switch to compatibility mode is disabled.

:HP32209SVPLUS INTRINSICS VERSION:  HP32209B.06.08      ------- --------------
SEGMENT VERSION
------- --------------
01 B'06'08'S01'00
02 B'06'08'S02'00
03 B'06'08'S03'00
04 B'06'08'S04'00
05 B'06'08'S05'00
06 B'06'08'S06'00
07 B'06'08'S07'00
08 B'06'08'S08'00
09 B'06'08'S09'00
10 B'06'08'S10'00
11 B'06'08'S11'00
12 B'06'08'S12'00
13 B'06'08'S13'00
14 B'06'08'S14'00
16 A.00.06.S16.00
17 B'06'08'S17'00
18 B'06'08'S18'00
19 B'06'08'S19'00
20 B'06'08'S20'00
21 B'06'08'S21'00
22 B'06'08'S22'00
------- --------------

VPLUS NATIVE MODE INTRINSICS VERSION: HP32209B.06.08
OVERLAY VERSION: B.06.08.00
FOR THIS USER:

VPLUS NATIVE MODE IS ENABLED;
VPLUS SWITCH TO COMPATIBILITY MODE IS DISABLED;
WILL DEFAULT COMPATIBILITY MODE SL SEARCH TO
SYSTEM SL

DHCF A4004000

VPLUS/Windows VERSION: HP36393A.00.06

VPLUS/Windows Native Mode VERSION: HP36393A.00.06
OVERLAY VERSION: A.00.06.00
Feedback to webmaster