You are here: Development Standards > OSAS Standards > Coding Conventions > Error Messages

# Error Messages

GENERROR is used to display error messages in OSAS. Many are system generated; some can be delivered by the program. The most common method is to set X9$ to the appropriate message and GOSUB GENERROR. Upon return from GENERROR, the program should allow reentry of the data field that caused the error, as in the following code:

1420 LET NUM=X
1430 IF NUM<1 OR NUM>3 THEN LET X9$="Must Enter 1-3"; GOSUB CLEAR_GLOBAL: GOSUB
1430:GENERROR; GOTO FIELD

GENERROR clears Y$ for the program. The program should assign the user entered data to the variable before displaying the error message so that the data can be seen and corrected after the message is acknowledged.

In GUI mode, you must also clear STBL(“DESTID”) to prevent looping problems when forcing certain fields.

Error messages should follow consistent standards. The error message should read like a sentence with the initial letter capitalized (as well as field names and file names). Range error messages should use one of these conventions:

Must enter x or y. | where x and y are the only valid entries
Must enter x-y. | where x and y define a range of valid entries
Must enter x, y, or z. | where x, y, and z are the only valid enteries

Beginning in version 5.00, verification errors use the O7=8 convention (see "GENERROR").