Previous Next        Current Page: NeXtMidas Training / Primitives / Lab 3* / Instructions
back
Start Here   
Background   
Common Midas Concepts   
Getting Started - Part 1   
Getting Started - Part 2   
Working with Files   
Option Trees   
Macros - Part 1 (Basics)   
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   
   + Overview   
   + Open, Process, Close   
   + Building   
   + The NeXtMidas API   
   + Lab 1   
   + Special Variables   
   + Lab 2   
   - Lab 3*   
      - Instructions   
      - Solution   
   + Files in a Primitive   
   + Lab 4   
   + Lab 5*   
   + Test Macros   
   + Lab 6   
   + Real Time Controls   
   + Lab 7   
   + Working with Messages   
   + Lab 8   
   + Primitive Restarts   
   + Introduction to DSP   
   + Lab 9   
WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • Lab 3:
    • Create a new primitive called primlab3.
    • The primitive should take in 1+ arguments.
      • Each argument will be the name of a result.
    • For each argument, get the result which matches that name.
      • If there is no matching result print out a warning that such a result does not exist.
      • If the result is a number, delete the result.
        • Tip: Use the StringUtil.isNumber(...) method.
      • If the result is not a number, print out a warning that the result can not be deleted.
    • In the case that the result is a number, print out an INFO statement explaining that it has been deleted (include the name of the result and its previous value in the message).
      • But only show this if the user supplies the /VERBOSE switch or if the command is run outside of a macro.
        • Tip: All commands have a verbose variable that is automatically set to true if /VERBOSE is set or if the command is run outside of a macro.
    • Build and test your primitive.
      • Try it with /VERBOSE=FALSE and /VERBOSE=TRUE.
      • Also try running it from a macro with and without the /VERBOSE switch.

back