TGAL Manual

TGAL Procedures
Tailoring TGAL
060865 Tandem Computers Incorporated 4–5
The exclamation points mark off the comments in the program. You change only the
lines marked with an arrow. The procedure determines the length of the error
messages; you need not supply any other information; for example:
PROC error^message(msgnum, buf, messlen);!
INT msgnum; ! the error number !
STRING .buf; ! place message here !
INT .messlen; ! return message length, max 60!
BEGIN ! !
STRING ! !
.sp; ! end-of-string pointer !
! !
CASE msgnum-1 OF ! branch on message type !
BEGIN ! !
buf ':=' "LOOK-AHEAD EXCEEDED" -> @sp;! !
buf ':=' "FILE READ ERROR" -> @sp; ! !
buf ':=' "FILE FORMAT ERROR" -> @sp; ! !
buf ':=' "FILE SEQUENCE ERROR" -> @sp;! !
buf ':=' "LINE TOO LONG" -> @sp; ! !
buf ':=' "DID YOU MISSPELL A COMMAND?" -> @sp;! changed msg !
buf ':=' "WARNING: TEXT EXCEEDS BOX SIZE" -> @sp;! !
buf ':=' "IN FILE MUST BE A TERMINAL, PROCESS, OR DISC FILE"! !
-> @sp;!!
OTHERWISE ! !
buf ':=' "**** I DON'T KNOW WHAT HAPPENED ****"-> @sp;!changed!
END; ! end of cases !
messlen := @sp '-' @buf; ! compute message length !
! !
END; ! end of error^message proc !