The MESAG.SBR code sample is a simple implementation of the old AlphaACCOUNTING MESAG.SBR routine used to display standard messages on the 24th or bottom line of the screen. In order to make the routine available to A-Shell, the following line should be added to the A-Shell initialisation file, MIAME.INI:
ALIAS=MESAG,JBXcall:MESAG
This will override the default MESAG.SBR implementation contained within A-Shell with the Visual Basic sample version. To call and test the MESAG.SBR routine, write a short AlphaBASIC test program, such as that given below:
INPUT ”Message:”,message$
INPUT ”Mode:”,mode
XCALL
MESAG,message$,mode
For users unfamiliar with MESAG.SBR, its functionality is quite simple: Based on the numeric mode value, which should be in the range of 1 – 6, MESAG.SBR will output a standard message, or the specified message, in one of a number of ways according to the following table.
This implementation of MESAG.SBR is not intended to be used as a production routine, but serves to show the different ways in which output can be presented to the user, and how the functionality of a standard XCALL routine could be enhanced when running under A-Shell for Windows:
Mode |
Action |
1 |
Outputs the message in a Windows ‘Warning’ message box. |
2 |
Outputs the message in a Windows ‘Information’ message box. |
3 |
Outputs “Invalid Entry - See Instructions” in a ‘Warning’ message box. |
4 |
Displays the message on the 24th line of the A-Shell display. |
5 |
Outputs “File now full - See instructions” in a ‘Critical’ message box, then exits A-Shell. |
6 |
Outputs “Invalid Selection" in a ‘Warning’ message box. Both GUI and 24th line implementations of the code are included. |