|
|
Communicator 3000 MPE/iX Release 6.0 (Platform Software Release C.60.00): HP 3000 MPE/iX Computer Systems > Chapter 10 Technical Articles Year 2000 and Other Enhancements in VPLUS |
|
by Kumar KN and Rajesh Channabasavaiah This article provides information on the following VPLUS enhancements available in version B.06.07.
A description of these features follows. VPLUS version B.06.07 contains enhancements to handle Year 2000 and beyond in applications. These enhancements can be grouped into three segments as follows:
Two new intrinsics have been added to VPLUS to handle dates in the next century. These are VGETYYYYMMDD and VPUTYYYYMMDD. These intrinsics are similar in structure and function to the existing intrinsics VGETYYMMDD and VPUTYYMMDD respectively. The difference is that the date values handled by the new intrinsics contain 4-digit year components. Converts data in the data buffer to a eight-byte character value and copies it to an application. Syntax
Parameters
Discussion VGETYYYYMMDD transfers the contents of the field specified by fieldnum to a variable in an application. The contents of the field are stored in a data buffer from which the value is taken. This value is converted to YYYYMMDD format and the converted value is placed in the application variable. The YYYYMMDD format is an 8-byte ASCII value, for example, 19961225. 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. Refer to the VGETtype intrinsic description in the Data Entry and Forms Management System VPLUS Reference Manual for related information. Example
These calls will convert the contents of the data buffer corresponding to the field specified by FIELDNUM and place the converted value into VARIABLE. Converts a numeric value representing a date from an application and copies the converted value to a field in the data buffer in memory. Syntax
Parameters
Discussion VPUTYYYYMMDD converts the contents of the application variable to the date order of the field specified by fieldnum and copies the converted value into the corresponding field in the data buffer, right justified. The application variable should contain a numeric value in YYYYMMDD format. The YYYYMMDD format is an 8-byte ASCII value, for example, 19961225. If errors occur during conversion, cstatus is set to an error code. Refer to the VPUTtype intrinsic description in the Data Entry and Forms Management System VPLUS Reference Manual for related information. Example
These calls will convert the contents of VARIABLE to a date value and place the converted value in the data buffer corresponding to the field specified by FIELDNUM. FORMSPEC Application Ready Buffer (ARB) processing has been enhanced with the addition of a new ARB data type. This data type can be specified on the DTC Menu for Data Type Conversions from Screen Type to Application Type. The new ARB Type is YYYYMD and is defined as a 8-byte ASCII field containing a date value in YMD order with no separators. Also the year component in the date value has 4 digits. Note that FORMSPEC will ensure a length of 8 for the data type YYYYMD in the ARB. In essence, the value is of the form YYYYMMDD (8 bytes) even though the Type designator on the DTC Menu has been abbreviated to YYYYMD. For more details on ARB Types and how to use them, refer to the "ARB Data Types" section in the Data Entry and Forms Management System VPLUS Reference Manual. Date processing in VPLUS has been enhanced to handle date values with 4-digit year components. Specifically, the following additions have been made. Date output will be formatted with 4-digit years if the target field is wide enough to receive the date, and the user requests this action. Examples of such output include the SET statement in FORMSPEC. The target field should be at least 10 characters in length to have a 4-digit year output. VPLUS, by default, will format date output with 2-digit years. To change the behavior as described above, define a JCW called VSETNEXTCENTURY and set bit 15 to 1 (bits are numbered from 0 through 15). It should be noted that this option will be active for fields wide enough to hold the 4-digit year date. For other fields, 2-digit years will be used. Existing 2-digit years can be interpreted differently to handle dates in the next century. Currently VPLUS handles year components 00-99 as 1900-1999. This scheme of interpretation can be changed. In the new scheme, 00-49 is interpreted as 2000-2049 and 50-99 is interpreted as 1950-1999. This interpretation will be valid through all processing done by VPLUS. For example, this scheme will allow the user to enter 02/29/00 (MDY order) in an existing application and have it processed correctly. To invoke the above method of date interpretation, define a JCW called VSETNEXTCENTURY and set bit 14 to 1. Note that this method is used for processing only 2-digit year dates and not 4-digit year dates. Note also that the display of 2-digit year dates is not affected by this enhancement. This means that 12/11/10 (MDY order) can refer to 1910 in one application and 2010 in another application.
FORMSPEC version B.06.07 has been enhanced to provide the capability to set the default Field Type and Data Type of a form. This capability can be used to reduce the time taken to complete the design of a new form. Two new fields for user input have been added to the Form Menu screen of FORMSPEC. One is for the default Field Type, and the other is for the default Data Type. On the Form Menu, the user typically specifies the name of the form and other characteristics of the form. In addition now, the user can specify the default Field Type and Data Type for the form. For a list of the allowable values for the Field Type and Data Type, refer to the Data Entry and Forms Management System VPLUS Reference Manual. All fields created newly for the form will have the Field Type and Data Type set to the default values supplied on the Form Menu.
This enhancement allows more than 52 single character fields to be defined for a Form. Currently the field tag which is defined for a field at screen design (creation) time should begin with an alphabetic character. This enhancement will allow several other characters to be used for the field tag, thus increasing the number of single character fields that can be defined for a Form. The following are the other characters which can be used for the field tag (defined at screen creation time):
In the case where one of the characters listed above (a Digit or a Special) is used in a single character field, the Field Name will be blanked out when the Field Menu is invoked for the field the first time. The user should input a new name for the field in this case. With this enhancement, a maximum of 80 single character fields can be defined for a Form. Forms created with previous versions of FORMSPEC can be used with this version without any modifications. Forms created with this version of FORMSPEC can be used with existing applications without any modifications. Forms created with this version of FORMSPEC can be used with previous versions of FORMSPEC. However, some extra characters may appear near the bottom of the Form Menu screen which should be ignored. These extraneous characters appear only once, the first time the Form Menu is invoked for the form, and they do not affect the functionality in any way. Two new intrinsics have been added to VPLUS to enable applications to access Save Fields. They are VGETSAVEFIELD and VPUTSAVEFIELD. The values of Save Fields can be accessed/changed using the new intrinsics. It is important to note that the values of the Save Fields cannot be modified in the forms file by these intrinsics. Copies contents of the specified save field from save field buffer in memory to an application. Syntax
Parameters
Discussion VGETSAVEFIELD transfers the contents of the save field specified by sfname to a variable in an application. If the number of bytes specified by buflen is less than the length of the save field, the bytes to the right are truncated. Following a successful transfer, actualen is set to the actual number of bytes transferred to sfbuf. VGETSAVEFIELD does not convert the data moved to the application variable. Example
These calls will transfer the contents of the save field specified by SFNAME to SFBUF. If the call is successful, ACTLEN will contain the exact number of bytes transferred. Copies data from an application to the specified save field in memory. Syntax
Parameters
Discussion VPUTSAVEFIELD transfers the contents of the application variable specified by sfbuf to the save field in memory specified by sfname. If the length of the save field is less than the length specified by buflen, the bytes to the right are truncated. Following a successful transfer, actualen is set to the actual number of bytes transferred to the save field in memory. Note that the contents of the save field as recorded in the forms file is not changed by a call to VPUTSAVEFIELD. Also VPUTSAVEFIELD does not convert the data moved to the save field in memory. Example
These calls will transfer the contents of the application buffer SFBUF to the save field in memory specified by SFNAME. If the call is successful ACTLEN will contain the exact number of bytes transferred. FORMSPEC provides an option to renumber forms interactively. A new command has been added to the Interactive FORMSPEC to renumber forms. This command is invoked by selecting option "N" on the Main Menu. The form to be renumbered should be specified in the field next to the keyword "N". (This field is the same as where you would specify a form when also selecting the "D" option.) This option is equivalent to the RENUMBER command in batch mode FORMSPEC. |
|