Previous Next        Current Page: NeXtMidas Training / Macros - Part 1 (Basics) / Macro Basics / Local vs Global Results
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   
      - What is a Macro?   
      - Types of Macros   
      - Local vs Global Results   
      - Macro Structure   
      - Lab 1 - Macro Basics   
         - Instructions   
         - Solution   
      - Lab 2 - Macro Basics   
         - Instructions   
         - Solution   
   + Loops and Control Structures   
   + Procedures and Subroutines   
   + Pipes in a Macro   
   + Messages in a Macro   
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   


  • Local vs Global Results:
    Local Results
    Are viewable only within the macro in which they were created.
    Results of one macro are not accessible by other macros.
    Results are not "left over" after the macro is done.
    Global Results
    Always available for read access.
    Global results are shared among all macros.
    Global results remain after the macro is done.
  • Results in a NeXtMidas Macro:
    • By default all results used in a NeXtMidas macro are Local Results.
      • This is the "cleanest" approach.
      • Prevents macros from interfering with each other.
      • All results are "cleaned up" when the macro ends.
    • Commands exist that can provide access to global results (RESULTS with the /GLOBAL switch) and it is possible to make a named result global (use the GLOBAL command).
      • These are rarely used.
X-Midas Users Take Note:
NeXtMidas macros default to using Local Results while X-Midas macros default to Global Results. When X-Midas uses local results it automatically mangles the name at run-time to keep the results of different macros separate. In NeXtMidas the names declared in the macro stay the same at run-time (a more advanced mechanism is used to keep the results of different macros separate). Results in a NeXtMidas macro do not turn into P<num>_<var> as in X-Midas.