<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=INVOKE</id>
	<title>INVOKE - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=INVOKE"/>
	<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=INVOKE&amp;action=history"/>
	<updated>2026-04-13T21:04:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.ice-online.com/index.php?title=INVOKE&amp;diff=738&amp;oldid=prev</id>
		<title>ConvertBot: invoke a method on an object and optionally return the result</title>
		<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=INVOKE&amp;diff=738&amp;oldid=prev"/>
		<updated>2020-04-27T22:04:42Z</updated>

		<summary type="html">&lt;p&gt;invoke a method on an object and optionally return the result&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;invoke a method on an object and optionally return the result&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;res=func,...,resn=funcN&amp;gt; - Tag/value pair or single function&lt;br /&gt;
&lt;br /&gt;
Keyword Only Parameters:&lt;br /&gt;
&lt;br /&gt;
[label] - Legacy tag for result, no longer needed&lt;br /&gt;
[func]  - Legacy tag for function, no longer needed&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This command invokes a method on an object accessible from the NeXtMidas&lt;br /&gt;
framework.  The function parameter is either a results entry, registry entry,&lt;br /&gt;
or fully qualified class name (case sensitive).  Multiple return and function&lt;br /&gt;
arguments are supported of the form:&lt;br /&gt;
&lt;br /&gt;
  invoke &amp;lt;res&amp;gt;=&amp;lt;func&amp;gt; ... &amp;lt;resN&amp;gt;=&amp;lt;funcN&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
  nM&amp;gt;invoke pi=java.lang.Math.pi deg2rad=nxm.sys.inc.Constants.DEG2RAD&lt;br /&gt;
&lt;br /&gt;
sets the results PI and DEG2RAD.&lt;br /&gt;
&lt;br /&gt;
If the function name has no parentheses, or has an empty set of parentheses,&lt;br /&gt;
the function is assumed to be a void function.  If the parentheses contain&lt;br /&gt;
arguments, separated by parenthesis, then NeXtMidas will convert these&lt;br /&gt;
arguments into types and search for a method with the determined types in the&lt;br /&gt;
given order.&lt;br /&gt;
&lt;br /&gt;
Commands are executed from left to right, chaining of method invocations is &lt;br /&gt;
not supported.  A return value is needed to change a result inplace.  Thus&lt;br /&gt;
&lt;br /&gt;
  nM&amp;gt; res str &amp;quot;a string&amp;quot;&lt;br /&gt;
  nM&amp;gt; invoke str.toUpperCase()  ! This DOES NOT CHANGE STR !!!&lt;br /&gt;
&lt;br /&gt;
does not upper case the string 'str', but&lt;br /&gt;
&lt;br /&gt;
  nM&amp;gt; res str &amp;quot;a string&amp;quot;&lt;br /&gt;
  nM&amp;gt; invoke str=str.toUpperCase()  ! This DOES CHANGE STR !!!&lt;br /&gt;
&lt;br /&gt;
changes str to &amp;quot;A STRING&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: Currently it is impossible to invoke a method in Table, KeyVector, or &lt;br /&gt;
other Keyable classes because everything goes through setKey/getKey.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
  * To determine the sin of 1.2&lt;br /&gt;
       nM&amp;gt; invoke D:x=java.lang.Math.sin(1.2)&lt;br /&gt;
         D: X               = 0.9320390859672263&lt;br /&gt;
  &lt;br /&gt;
  * To determine the pi and &lt;br /&gt;
       nM&amp;gt; invoke D:pi=java.lang.Math.pi &lt;br /&gt;
  &lt;br /&gt;
  * From inside a macro, clean the arguments to the macro:&lt;br /&gt;
       nM&amp;gt; invoke S:str=this.args.clean&lt;br /&gt;
  &lt;br /&gt;
  * To get the name of a layer:&lt;br /&gt;
       nM&amp;gt; plot/bg world&lt;br /&gt;
       nM&amp;gt; invoke name=PLOT.LAYERS.WORLD.NAME()&lt;br /&gt;
        5S: NAME            = WORLD&lt;br /&gt;
  &lt;br /&gt;
  * To get the mask value of the string X|Z&lt;br /&gt;
       nM&amp;gt; invoke L:maskVal=nxm.sys.lib.Parser.mask(&amp;quot;X,Y,Z&amp;quot;,&amp;quot;X|Z&amp;quot;,2)&lt;br /&gt;
         L: MASKVAL         = 5&lt;br /&gt;
&lt;br /&gt;
  * Create a new instance of java.lang.Integer (note that &amp;quot;&amp;lt;init&amp;gt;&amp;quot; is the &lt;br /&gt;
    internal Java name for the constructor) [Since NeXtMidas 2.1.0] :&lt;br /&gt;
       nM&amp;gt; invoke temp=java.lang.Integer.&amp;lt;init&amp;gt;(4)&lt;br /&gt;
&lt;br /&gt;
     this is the same as using:&lt;br /&gt;
       nM&amp;gt; new java.lang.Integer(4) temp&lt;br /&gt;
&lt;br /&gt;
Switches:&lt;br /&gt;
  /VERBOSE - Show more output&lt;br /&gt;
&lt;br /&gt;
See Also:  NEW, SET, RESULTS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:NXM_Explain]]&lt;/div&gt;</summary>
		<author><name>ConvertBot</name></author>
		
	</entry>
</feed>