Previous Next        Current Page: NeXtMidas User's Guide / System Operation / Switches
FAQs   
Release Information   
Getting Help   
Basic Concepts   
Result Parameters   
XML Support   
Files   
System Operation   
   - Basic Command Form   
   + Parameters   
   - Switches   
      - Universal Switches   
   + Metacharacters   
   - Inline Calculations   
   - Function Invocation   
Macros   
Applets and WebStart   
Graphics   
X-Midas Interoperability   
Third-Party Compatibility   
Installation and Customization   
Running NeXtMidas Independently   
Glossary   


Switches

Switches are placed directly on the command line to modify the normal behavior of the command without changing the calling sequence or number of parameters. They trigger system-supplied features or provide additional command capability while preserving backward compatibility of the command. Switches may be placed directly after the command name or on the command line after all parameters, and must be spelled exactly or they are ignored. A switch name is preceded with a forward slash ( / ) and cannot be abbreviated (switches evoke exceptional behavior, so they must be entered exactly).

Each switch can be either a state or a value switch. A state switch enables a particular feature simply by being present:

nM> invoke/verbose NM2METERS nxm.sys.inc.Constants.NM2METERS  ! Enables verbose output
A value switch specifies a given parameter/setting to use:
nM> plot/cmap=gray apenny.prm ! Uses the gray color map
Note that in NeXtMidas any state switch can be treated as a value switch that takes in a state value (TRUE/FALSE, YES/NO, ON/OFF, 1/0, etc.):
nM> invoke/verbose=on  NM2METERS nxm.sys.inc.Constants.NM2METERS ! Verbose output is ON
nM> invoke/verbose=off NM2METERS nxm.sys.inc.Constants.NM2METERS ! Verbose output is OFF

A summary of the switches associated with a given command, are should be listed near the end of the explain file.

nM> EXPLAIN <command>

In general, command switches either trail the command name or are treated as additional parameters at the end of a command line, which makes both of the following equivalent:

nM> plot apenny.prm /cmap=gray
and
nM> plot/cmap=gray apenny.prm

If multiple switches are provided immediately following the name of the command, there should be no space separating them, for example:

nM> plot/cmap=gray/legend apenny.prm

If multiple switches are provided at the end of the command line, each switch must be proceeded by a space, for example:

nM> plot apenny.prm /cmap=gray /legend

Global Switches

A "global" switch will be applied to all commands. Use of global switches can be problematic since they apply to all commands, whether inside a macro or not. Even minor changes to the global switch settings can cause unanticipated behavior within a macro. As such, NeXtMidas does not support global switches.

Macro Switches

A "macro" switch will be applied to all commands within a macro. Macro switches are supplied in one of three ways:

  1. In the command dictionary (see UPDATE).
  2. Immediately folloring STARTMACRO at the top of the macro.
    startmacro/myswitch d:freq
      ...
    endmacro
  3. When calling the macro.
    nM> mymacro/myswitch

For example, the following changes the default pipe size on all the pipes in the macro:

startmacro/ps=1m
  noop file _out  ! pipe size will be 1m
endmacro
  

Macro switches should be used with care since different commands may use a switch with the same name but have slightly different behavior associated with it.

Universal Switches

A "universal" switch is merely a switch that is common across a wide range of commands. These switches are typically handled by NeXtMidas proper and not by a specific command. (Most explain files omit universal switches.)

A complete list of universal switches can be found here