Published By | Date | Version | Knowledge Level | Keywords |
---|---|---|---|---|
Revelation Technologies | 14 NOV 1989 | 2.X | EXPERT | MSG |
MSG is Advanced Revelation's standard message handling utility. Existing messages can be called or new messages created.
Facilities are provided to solicit and respond to user input.
The record key for a specific message in the MESSAGES file, or an expression consisting of literal data and/or replaceable parameters. MSG first searches the system message buffer (@MESSAGES), then the MESSAGES file. If the record is not found message is assumed to be an expression. The replaceable parameters are runtime variables, which are replaced by a system or user-specified value. Literal data may appear as multiple display lines, the intended lines separated by either @VM or |. The following replaceable parameters are available:
Parameter | Value |
---|---|
%0% | Replaced by the record key for the specified message record |
%n% | Replaced by element n in values |
%D% | Replaced by the current date ('D' format) |
%T% | Replaced by the current time ('MTHS' format) |
%B% | Rings a bell |
%G% | Replaced by all specified values |
%Cn% | Replaced by the ASCII character corresponding to the specified integer value. The literal character C must precede the integer. |
map | A message record. The fields are mapped to the corresponding fields in the MESSAGES file. Unspecified fields assume their default value. Multiple fields must be separated by either @FM or |. See the table below for the defined fields (see Appendix 2, Message Record for complete descriptions) |
Field | Descriptor |
---|---|
<<1>> | Type (defaults to A) |
<<2>> | Buffered (defaults to unbuffered) |
<<3>> | Column (defaults to vertically centered) |
<<4>> | Row (defaults to horizontally centered) |
<<5>> | Attribute (defaults to @EW) |
<<6>> | Justification (defaults to centered) |
<<7>> | Width (defaults to longest line specified in Script (see below) or @CRTWIDE) |
<<8>> | Border (defaults to 5) |
<<9>> | Program (unused) |
<<10>> | Category (unused) |
<<11>> | Script (no default) |
<<12>> | Char.Count (defaults to 64K) |
Used primarily by MSG to return user input or store a previous display image (see below). If specified, response must be an initialized variable or literal data. This value may serve as the default for those messages accepting user input. The manner in which a response value is processed is determined by the message type specified in map. The following Message record type specifiers return a value in response:
U, UB | Saves the current display image in response, then displays message |
R | Displays message and an edit line, and returns any input data. If response is specified, it is displayed at the edit line, and serves as the default value returned. The user may edit the data displayed. |
RC | The same as the R type, except all lowercase characters are converted to uppercase when the data is returned |
RE | The same as the R type, except the ASCII code for the escape character will be returned if pressed |
RI | Displays message and an input line (see R/BASIC INPUT, and returns any input data |
A dynamic array of values supplied to any replaceable parameters specified in message. The values must maintain the ordering of their respective parameters. Multiple values must be delimited by either @FM or |.
Depending upon the message record type specified, MSG may pass a value in the response argument list parameter (see above).
*Initialization and default values DECLARE SUBROUTINE MSG MESSAGE = '' MAP = '' TYPE = 1 BORDER = 8 RESPONSE = '' VALUES = '' *Display a literal, double-line message MESSAGE = 'The first line | the second line' MSG(MESSAGE,MAP,RESPONSE,VALUES) *Display a message stored in the MESSAGES file MESSAGE = 'W714' MSG(MESSAGE,MAP,RESPONSE,VALUES) *Display a message with replaceable parameters MESSAGE = '%1% | %2%' VALUES = 'Here a parameter | there a parameter' MSG(MESSAGE,MAP,RESPONSE,VALUES) *Display a message with combined data MESSAGE = 'The keys %1% and %3% are not in the list' VALUES = '001 | 014 | 288' MSG(MESSAGE,MAP,RESPONSE,VALUES) *Display a message with a specified response and accept input, *displaying the (possibly) modified data MESSAGE = 'Change this return value if you wish' MAP<TYPE> = 'R' RESPONSE = '2150 Balboa St.' MSG(MESSAGE,MAP,RESPONSE,VALUES) MSG('The accepted data is:|%1%','','',RESPONSE) *Display a message with a specified border, pause for input *then remove message. RESPONSE will contain the saved display *image. MESSAGE = 'Hit any key and this message will be removed' MAP<TYPE> = 'UB' MAP<BORDER> = 1 RESPONSE = '' MSG(MESSAGE,MAP,RESPONSE,'') CALL INPUT.CHAR() MAP<TYPE> = 'DB' MSG('',MAP,RESPONSE,'')