Current Page: NeXtMidas Training Macros - Part 1 (Basics) Messages in a Macro Processing Messages
- - - | Processing Messages (the `processMessage` procedure): All messages sent to a macro are passed to the `processMessage` procedure. A simple `processMessage` procedure looks like this:
          procedure processMessage m:msg
            say "Got message name=^{msg.name} with &
                 info=^{msg.info}, data=^{msg.data} &
                 from ^{msg.from}"
          return
Most `processMessage` procedures include a large `IF...ELSEIF...ELSE...ENDIF` block used to process the messages based on their name, data and/or source (i.e. from).
X-Midas Users Take Note:
The `processMessage` procedure in NeXtMidas takes the place of the `controls` section of X-Midas. All graphical widgets in NeXtMidas send their messages to `processMessage` (this will be discussed in the section on Macro Graphics).