Previous Next        Current Page: NeXtMidas Training / Macros - Part 1 (Basics) / Messages in a Macro / Processing Messages
Start Here   
Background   
Common Midas Concepts   
Getting Started - Part 1   
Getting Started - Part 2   
Working with Files   
Option Trees   
Macros - Part 1 (Basics)   
   + Macro Basics   
   + Loops and Control Structures   
   + Procedures and Subroutines   
   + Pipes in a Macro   
   - Messages in a Macro   
      - Message Queue   
      - Message Structure   
      - Sending Messages   
      - Receiving Messages   
      - Processing Messages   
      - Lab 1 - Macro Messages   
         - Instructions   
         - Solution   
      - Lab 2 - Macro Messages   
         - Instructions   
         - Solution   
Macros - Part 2 (Graphics)   
NetBeans - Part 1 (Setup)   
NetBeans - Part 2 (GUIs)   
NetBeans - Part 3 (Profiler)   
Eclipse - Part 1 (Setup)   
Eclipse - Part 2 (GUIs)   
Primitives   
Applets & WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • 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).