MESSAGE_LIB |
Establish Message Library |
MESSAGE_LIB filename$[,NBF=num][,ERR=stmtref] | |
MESSAGE_LIB ADD filename$[,NBF=num][,ERR=stmtref] | |
MESSAGE_LIB DROP filename$[,ERR=stmtref] | |
MESSAGE_LIB POP [,ERR=stmtref] |
Where:
filename |
Name of the variable length Direct/Keyed file to be used as a message library. String expression. |
num |
Number of buffers to allocate. |
stmtref |
Program line number or statement label to which to transfer control. |
Use the MESSAGE_LIB directive to designate files as containing messages to be returned by the MSG( ) function. A message library must be a variable length Direct/Keyed file with the message identifier as the key. The record contains the message.
There is an alternate key to the *msglib.en (and any newly created MESSAGE_LIB files) on the first 50 characters of the message field. (as of PxPlus v4.12)
MESSAGE_LIB filename$[,NBF=num][,ERR=stmtref]
Use this format to designate and add filename(s) to the MESSAGE_LIB list. In earlier versions of PxPlus, only one message library could be active at a time when using a MESSAGE_LIB directive. PxPlus closed any other currently active message library and designated your given file as the new one. Currently, you can now have more than one message library active at a time. With use of the MSG( ) function, the message libraries are searched in order until a match is found.
An error is generated if the file cannot be properly opened. Use NBF= to specify the number of buffers to allocate. The filename$ expression can contain one or more MESSAGE_LIB filenames, each SEP-separated, so that you can reset the entire list in one command.
keyed "MESSAGE.LIB",10,0,-256
open (1)"MESSAGE.LIB"
write record (1,key="NOCUST")"Sorry but Customer %1 is not valid"
close (1)
message_lib "MESSAGE.LIB"
print msg("NOCUST","0001")
Sorry but Customer 0001 is not valid
0010 message_lib "*MSGLIB."+env("LANG"),err=0020;goto 0100
0020 message_lib "*MSGLIB.EN"
0100 rem...
0110 ! ...
1000 read (CST_FN,key=K$,dom=1900)
1010 ! ...
1900 print msg("REC_MISS",K$)
MESSAGE_LIB ADD filename$[,NBF=num][,ERR=stmtref]
Use this format to add a filename$ to the top of the list of message library to search. An error is generated if the MESSAGE_LIB file cannot be properly opened. Use the NBF= option to specify the number of buffers to allocate.
MESSAGE_LIB DROP filename$[,ERR=stmtref]
This format removes the specified filename$ from the list of message libraries to search. An Error #12: File does not exist (or already exists) is generated if the filename$ is not on the list.
MESSAGE_LIB POP [,ERR=stmtref]
Use this format to remove the top filename$ from the list of message libraries to search. An Error #12: File does not exist (or already exists) is generated if filename$ is empty.
MSG( ) Return Message Text
KEYED Create Single/Multi-Keyed File
DIRECT Create File with Keyed Access