Previous Next        Current Page: NeXtMidas Training / Getting Started - Part 2 / Advanced Results Parameters / Using Flag Strings
back
Start Here   
Background   
Common Midas Concepts   
Getting Started - Part 1   
Getting Started - Part 2   
   - Advanced Results Parameters   
      - Tables   
         - Creating   
         - Accessing   
         - Modifying   
         - Advanced   
      - In-Line Functions   
      - Objects   
         - The Invoke and New Commands   
      - Using Carets   
      - Using Flag Strings   
      - Automatic Type Conversion   
      - Type Casting   
   + Lab 3   
   + Threads in NeXtMidas   
   + Lab 4   
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   
WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • Using Flag Strings
    • Many NeXtMidas commands (such as PLOT) use the concept of flag strings.
    • Flag strings are string representations of flag numbers.
    • Flag strings are preferred over flag numbers because:
      • Strings are more readable
      • Allows new flags to be added or removed more easily.
    • The pipe character (|) is used to separate flag strings.
      nM> plot fftdemo /bg
      nM> set reg.plot.readout "SHOW|ONTITLE|ONAXIS|X|Y"
      
    • The tilde character (~) is often used to toggle a flag.
      nM> set reg.plot.readout ~SHOW ! Toggles on -> off
      nM> set reg.plot.readout ~SHOW ! Toggles off -> on
      
    • The minus character (-) is used to remove a flag.
      nM> set reg.plot.readout -ONTITLE
      nM> set reg.plot.readout -VIEW
      
    • The plus character (+) is used to add a flag.
      nM> set reg.plot.readout +ONTITLE
      
    • Flag strings modifiers like plus (+) and minus (-) can be used in conjunction with the pipe (|) separator
      nM> set reg.plot.readout -ONTITLE|+VIEW
      
    • Deprecated: In the past it was possible to use the hex values to set the flags (e.g. "0X4786"); this is deprecated since the hex values mean nothing to someone reading your macro, and they are not backwards-compatible if a new mask option is added.
Java Experts Take Note:
Duke Most of the work for converting flags to Strings is done in the Parser class in the methods mask and mask2s.

back