Topic : The GFA-Basic Compendium Author : GFA Systemtechnik GmbH Version : GFABasic.HYP v2.98 (12/31/2023) Subject : Documentation/Programming Nodes : 899 Index Size : 28056 HCP-Version : 3 Compiled on : Atari @charset : atarist @lang : @default : Document not found @help : Help @options : +g -i -s +z @width : 75 @hostname : STRNGSRV @hostname : CAB @hostname : HIGHWIRE @hostname : THING View Ref-FileON MENU MESSAGE GOSUB proc proc: procedure name If a message arrives in the message buffer, then the program branches to the procedure with the name proc. The monitoring of the message buffer takes place with each ON MENU command. The structure of the message buffer is discussed in the section concerning MENU(). Example: DIM m$(10) FOR i%=0 TO 10 READ m$(i%) NEXT i% DATA Desk,Redraw,------------------------- DATA 1,2,3,4,5,6,"","" OPENW 4,0,0 MENU m$() ON MENU MESSAGE GOSUB read_message PRINT AT(1,1); REPEAT ON MENU UNTIL MOUSEK=2 ' PROCEDURE read_message IF MENU(1)=20 PRINT CHR$(7); PRINT "A screen section must be redrawn" ELSE PRINT CHR$(7); PRINT "Something has happened !!!" ENDIF RETURN --> To test this program, an accessory must be loaded. If selected, then the program announces that a screen section was covered and has to be redrawn (see also MENU()). At the beginning this message appears once. The program can be terminated with a press of the right mouse button. Memo: If the procedure used with ON MENU MESSAGE is undefined the compiler will not issue and error message. Instead the compiler writes a bad binary where ON MENU MESSAGE is translated into JSR 0.l! evnt_mesag()+