Previous Next        Current Page: NeXtMidas Training / Primitives / Special Variables / List of Variables / MA
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   
      - List of Variables   
         - M   
         - MA   
         - MQ, MR, MW   
   + Lab 2   
   + Lab 3*   
   + 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   


  • The command line Args (MA):
    • Makes it possible to get the values of command line arguments.
      MA.getD(<name>) Get parameter <name> as a double.
      MA.getF(<name>) Get parameter <name> as a float.
      MA.getX(<name>) Get parameter <name> as a XLONG (Java long).
      MA.getL(<name>) Get parameter <name> as a LONG (Java int).
      MA.getI(<name>) Get parameter <name> as an INT (Java short).
      MA.getB(<name>) Get parameter <name> as a byte.
      MA.getS(<name>) Get parameter <name> as a String.
      MA.getU(<name>) Get parameter <name> as an (untranslated) String.
      MA.getO(<name>) Get parameter <name> as an Object.
      MA.getState(<name>) Get parameter <name> as a boolean state.
      MA.getTable(<name>) Get parameter <name> as a Table object.
      MA.getTime(<name>) Get parameter <name> as a Time object.
      etc.  
      (A complete list is contained in the API for Args!)
    • Note that the <name> should always be capitalized.
    • When adding your command to the dictionary using UPDATE, the default value for the argument should be specified as <NAME>= for each required input command line argument. See Command Dictionary Entries for review.
    • To get the value of a switch use the same methods but include a slash before the name.
      MA.getD("/POLL")
    • The MA.find(<name>) function will indicate if a named parameter (or switch) is specified.
      • This should not be used to determine if a switch is set (it returns true when the switch appears on the commandline, even if set to FALSE).
    • It is possible to get arguments based on their order on the command line.
      • This should only be used for primitives that take in an undefined number of arguments.
    • Some examples
      String  inStr   = MA.getS("IN_STR");
      int     myint   = MA.getL("NUM");
      double  freq    = MA.getD("FREQ");
      boolean debug   = MA.getState("DEBUG");
      double  poll    = MA.getD("/POLL");     // get /POLL switch
      boolean hasPoll = MA.find("/POLL");     // true if /POLL switch is specified
                    
      Then when adding your command to Command Dictionary (via UPDATE)
      nM> update myprim
      Option tree (USER, SITE, UCL, etc): [] -> train
      MYPRIM Abbreviation: [MYPRIM] -> myprim
      Support [P] -> P
      Number of arguments [0] -> 4
      Default 1 [] -> IN_STR="please enter your name here"
      Default 2 [] -> NUM=
      Default 3 [] -> FREQ=
      Default 4 [] -> DEBUG=
      nM>
      nM> defaults myprim
      INFO: MYPRIM*;TRAIN       P,4     ,IN_STR="please enter your name here",NUM=,FREQ=,DEBUG=,
                   
Java Experts Take Note:
The naming convention for the integer types differs from Java. This is for historical reasons, to keep the terminology the same across all Midas frameworks. (The names originated on VMS which used a 16-bit integer type.)

X-Midas Users Take Note:
The MA.get_(...) methods fill the role of both the M$PICK_(...) and the M$GET_?SWITCH(...) methods in X-Midas. NeXtMidas also uses names for the parameters.

back