Paradyme V4.0 - Manual

Entry of prompt definition

Validation Code


In the fields for validation code you can include special validation that will be carried out on the values entered by the user of the generated routine.

The validation statements are inserted in the processing for the field with the same prompt index. They are inserted into the generated program as additional 'CASE' statements. The statements you enter are error traps, that is, if the validation test returns a TRUE result during runtime, it indicates that input is incorrect and the associated error message is printed (if you do not enter an error message a default message 'Invalid Input' is displayed).

An exception to this is that if you wish to trap a particular type of input but not flag it as an error (say, if you intend to use inserted code to handle the value) then you can specify an error message number of zero. No error message will be produced and whatever code follows the condition is executed. An example of such a statement would be :-

VALUE$ = "V" ; CALL SUB.NAME

Entering [INVERT] at the 'Msg No' prompt will take you to the error message entry screen and allow you to choose an existing message or add a new one. For more details, refer to chapter 10 - Error message entry.

Prompt Index

Here you enter the prompt number of the prompt which the validation refers to. The number entered must be one used in the parameter definition for an input prompt, i.e. An 'S' or 'I' type variable.

Validation Code

Here a validation statement may be entered. The value entered will be appended to the 'CASE' keyword, so the word 'CASE' need not be entered. This code is inserted into the central CASE block of the appropriate input/validation routine.

The validation entered must follow the standard rules for a conditional expression as given in the programming manual and can include any variables used in the program. If the condition expressed here is satisfied then an error message is displayed, with the exception that no error message is printed if error message number zero is specified.

Msg No

The value entered here gives the message, as defined in option 6 of the main menu, that will be printed should the associated validation prove positive, i.e. the input is invalid. This error message will be printed within the special video effects as defined in the system variables REV.ON$ and REV.OFF$.

If no message number is specified or no message has been setup for the message number then the message 'INVALID INPUT' will be printed at runtime.

If 0 is specified for the message number then the PRINT statement that would follow the generated CASE statement is not produced. So, only CASE followed by the validation text would be created. This way it is possible to call a routine in the case of a particular input other that the one that is written away to the main update record. The following validation with message 0 would be an example of this use.

FUNCTION$ = HELP$ OR VALUE$ = 'SOMETHING' ; GOSUB 3100

If the user has not defined the error message and its number when he gets to this field, it is possible to enter these values at this point of the processing.

If the user hits the [INVERT] key, the user will be taken into the error message definition screen where the message numbers and error messages can be entered. When the user exits the error message definition screen, processing will continue from the point on the prompt definition screen where the [INVERT] key was hit. This method can also be used to review existing error messages.


Use the BACK BUTTON to return to the previous page