Previous Next        Current Page: NeXtMidas Training / Getting Started - Part 2 / Advanced Results Parameters / Automatic Type Conversion
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   


  • Automatic Type Conversion
    • When NeXtMidas encounters a parameter in a macro or on the command line, it tries to automatically convert it to the correct type.
      • If it matches the name of a result, that result is used (result substitution).
      • If a caret is used, NeXtMidas will substitute the text value of the named result (result expansion).
      • If the value is inside quotes, it will be a case-sensitive string.
      • If it has curly braces, it becomes a table.
      • If it looks like a number, it becomes a number.
      • If none of the above apply, it becomes an uppercase string.
    • When using a caret in conjunction with a string value you will want to quote the results of the expansion.
      nM> set mystring "Hello World!"
      nM> set copystring "^{mystring}"
    • There is a detailed explanation of Automatic Type Conversion in the NeXtMidas User's Guide under the Result Parameters section.
Java Experts Take Note:
The difference between result substitution and result expansion is that substitution copies a pointer to the existing result while expansion copies the text value of the result.

back