Previous Next        Current Page: NeXtMidas Training / Getting Started - Part 2 / Advanced Results Parameters / Objects / The Invoke and New Commands
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   
Applets & WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • The INVOKE and NEW commands
      The INVOKE and NEW commands allow for complex Java object manipulation.
    • NEW is used to create (construct) a Java object.
      nM> new java.lang.Double("10.12345678901234567") D
      nM> res d.getClass()
        O: D.GETCLASS()    = class java.lang.Double
      
    • INVOKE is used to call complex methods in a Java object.
      nM> new java.lang.String("a string with more") str
      nM> invoke ,,str.regionMatches(0,"a string",0,8)
      Invoke: ANSWER = true
      
  • INVOKE and NEW can be very powerful tools for evaluating and understanding how to use Java classes.
Java Experts Take Note:
NeXtMidas automatically converts the arguments for INVOKE and NEW from strings into objects. This creates a number of limitations:
  • If multiple methods have the same name the "wrong" one may be called (e.g. setFoo(int) and setFoo(String) when given 2)
  • It is not possible to use a null since it is treated as the string "null".
  • It is difficult to call a method that takes in an object array.