VCHANGEFIELD [ HP Data Entry and Forms Management System (VPLUS/V) ] MPE/iX 5.0 Documentation
HP Data Entry and Forms Management System (VPLUS/V)
VCHANGEFIELD
Allows dynamic field attribute definition.
Syntax
VCHANGEFIELD {comarea,specbuffer,numentries}
Parameters
comarea Must be comarea specified when forms file was opened
with VOPENFORMF. If not already set, the following
comarea items must be set before calling VCHANGEFIELD:
cstatus Set to zero.
language Set to code identifying the programming
language of the calling program.
comarealen Set to total number of two-byte words
in comarea.
VCHANGEFIELD may set the following comarea items:
cstatus Set to nonzero value if call
unsuccessful.
specbuffer A record; the specifications buffer is an array that
provides VCHANGEFIELD with the information regarding the
fields which are to be altered. The format of the array
is as shown in Table 6-8.
numentries A two-byte integer indicating the number of entries in
the specifications buffer. The specifications buffer
can contain up to three types of changes for each field
in the form. That is, one call to VCHANGEFIELD can
change the field type, data type and enhancement of
every field in a form. For example, if a form contains
four fields and an application is designed to make three
changes to each field, then numentries should have a
value of 12.
Discussion
VCHANGEFIELD alters the run-time copy of the current form. It does not
modify the contents of the forms file. The next call to VGETNEXTFORM
which actually retrieves a copy of the form from the forms file will
reset the field specifications. The only exception to this is when two
calls to VGETNEXTFORM are performed without resetting nfname; the second
call will not retrieve the form definition from the forms file.
Please note that it is the responsibility of the programmer to ensure
that a new data type is compatible with any initial values or processing
specifications which may have been defined for the field.
If the change type selected is a toggle type, (change type of 1, 2 or
3), the change specification buffer is returned with the "old"
characteristics. Hence, the next VCHANGEFIELD call with the same buffer
will toggle between the characteristics specified in the first
VCHANGEFIELD call and the original characteristics. To toggle between
two specific characteristics, VCHANGEFIELD can be used to set a field
(change type of 4, 5, or 6) to certain starting characteristics without
the toggle option at first.
Table 6-8. Specifications Buffer
----------------------------------------------------------------------------------------------
| | | |
| Data Type | Position | Description |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| Integer | 1 | positive field number or negative screen order number |
| (Two-byte) | | |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| Integer | 2 | Change type |
| (Two-byte) | | 1 = toggle enhancement |
| | | 2 = toggle field type |
| | | 3 = toggle data type |
| | | 4 = change enhancement |
| | | 5 = change field type |
| | | 6 = change data type |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| Character | 3-4 | Change Specifications |
| array | | Type 1, 4 values = H, I, B, U, NONE |
| (4-byte) | | Type 2, 5 values = 0, D, P, R |
| | | Type 3, 6 values = CHAR, DIG, IMPn, NUM [n], DMY, MDY, YMD |
| | | |
----------------------------------------------------------------------------------------------
VCHANGEFIELD has no effect on the security or color enhancements; an
error is returned if the codes for these enhancements (1-8 or S) are
specified. VCHANGEFIELD does not alter the field error enhancement nor
is this enhancement code returned when the enhancement attribute is
toggled (rather the current "normal" enhancement is altered and returned
if toggling).
Example
COBOL
CALL "VCHANGEFIELD" USING COMAREA,SPECBUF,ENTRIES.
BASIC
CALL VCHANGEFIELD(C(*),Bl,EN)
FORTRAN
CALL VCHANGEFIELD(COMAREA,SPECBUF,ENTRIES);
SPL/PASCAL
VCHANGEFIELD(COMAREA,SPECBUF,ENTRIES);
MPE/iX 5.0 Documentation