Input Field Processing [ HP ALLBASE/4GL Developer Self-Paced Training Guide ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Self-Paced Training Guide
Input Field Processing
HP ALLBASE/4GL performs input field processing for input fields after
display processing for the field has been completed.
1. When HP ALLBASE/4GL first enters this processing sub-system, it
places the cursor in the current field and waits for user input.
This is the only time that HP ALLBASE/4GL accepts any form of user
input, including function keys or cursor movement requests.
A field commit action indicates that data entry for the field is
complete. Some actions that constitute a field commit are:
* Moving the cursor off the field by:
* Pressing Return,
* Pressing Tab or Shift + Tab followed by Return,
* Moving the cursor to another field by pressing
cursor up cursor down or cursor home followed by
Return.
* Pressing the Commit Data function key.
_________________________________________________________________
NOTE In general, pressing a function key other than Commit Data
does not initiate a field commit.
_________________________________________________________________
There are only two cases in which a field commit occurs as a
result of pressing a function key:
* If the action behind the key initiates a commit data
action, or
* If the action is a function which moves a new value to
*FIELDNO, a field commit occurs on return to the screen
field.
Once HP ALLBASE/4GL accepts the field commit, the remainder of the
input field processing is executed.
2. HP ALLBASE/4GL determines if the field commit is a new commit
action for this field. A new field commit is recognized for the
following situations:
* The data in the screen field has altered since the last
commit action for the field.
* A different numbered input field has been processed since
this field was last committed.
3. If the field commit is not a new commit action, HP ALLBASE/4GL
checks to see if an error was generated by the previous commit
action. If an error was generated on the previous commit, this
commit action is accepted. Otherwise input processing for the
field is terminated.
4. The data input in the screen field is accepted into the screen
buffer.
5. HP ALLBASE/4GL now validates the screen field buffer contents.
Firstly, the following automatic system tests are performed:
* Field Requirements. Validation fails under the following
circumstances:
* The field is blank and it is defined as a required
field,
* Less than the defined minimum number of characters
for the field have been entered.
* Data Type Requirements. HP ALLBASE/4GL performs the
following data type validation:
* Correct data type for edit code,
* If a date field, validate the date format,
* If numeric, validate number of decimal places,
* If signed numeric, validate sign.
If any of these criteria are not met, HP ALLBASE/4GL generates an
error signal, displays a standard system error message, and
terminates the validation.
If the input field data passes the system validation tests, any
developer specified validation tests (if specified) are applied.
These tests are as follows:
* Value within a specified range.
* Value in a specified table.
If either of these tests fail, HP ALLBASE/4GL displays the
developer defined message assigned to the range or table. If
there is no message associated with the range or table, HP
ALLBASE/4GL displays a default system error message.
Error messages are one of five different types of messages. They
are the most important type of message in terms of their effect on
input field processing logic. They provide an automatic means of
ensuring that the user enters valid data in a field. You will
define a number of messages in later lessons.
6. If the validation tests of the screen field data initiate an error
message, processing returns to step 1 and the user must re-enter
the field data.
7. When the field data has been accepted and validated, the switch
*ENTERED is set on. This allows you to determine whether the
function is being performed prior to, or after, data entry for the
field.
8. The function, if specified as an after function, or as both a
prior and after function, is executed.
9. The function, through its processing, may initiate an error
message. If so, processing branches to step 11.
10. HP ALLBASE/4GL now performs the automatic data movement for the
field. The contents of the screen buffer are moved to the primary
data movement field, and the other data movement fields.
Processing of the field is complete.
11. If the after function generates an error message, HP ALLBASE/4GL
tests the value in the *FIELDNO communication area field. If this
value has not been modified by the function, processing returns to
the beginning of the field (Step 1). However, if the function has
modified the value in *FIELDNO, HP ALLBASE/4GL restores the
contents of the field to the condition that existed at the start
of the input processing, and then terminates processing of the
field.
MPE/iX 5.0 Documentation