The Method Node
A Method node () represents a method — a small program that runs when called from other nodes, such as Event nodes, Item nodes, Buttons nodes, and other Method nodes. The name of the Method node is the name of the method, which you can enter in the Name field. Right-click and choose Edit () to open an editor window where you can edit the method. For local methods, click the Go to Source button () to move to the form object from which the local methods is created. See Creating Methods and The Method Nodes and Method Editor Windows for information about creating methods and Debugging and Running Methods for Applications for information about the debugging tools.
Methods can also be used to run code in connection with a model defined in the Model Builder window. The Show in Model Builder check box is selected by default. The method then appears in the Run Method list in the Developer ribbon.
The Show in Model Builder check box is only active for global methods. Form methods and local methods are not possible to show in the Model Builder. Furthermore, for local methods, no settings are editable in the Methods node’s Settings window.
The Settings window for a Method node contains the following section.
Inputs and Output
In the table under Inputs, you can add one or more inputs to the method. Click the Add button () to add an argument to the list.
In the Name column, you can edit the name of the argument (default: arg1, and so on). In the Type column, choose a data type (String, Boolean, Integer, Double, or a 1D or 2D array type). You can assign a default value in the Default column; the syntax is the same as for declarations (see Array Syntax). You can also enter a description of the input in the Description column. The descriptions can be used to annotate the method parameters and as a label for inputs in Method Call features.
For method inputs of the double types, there is an optional unit definition that you define in the Unit column The unit definition is used by Method Call features to append a label to the input text field and to convert values to the desired unit when running the method call.
Use the Move Up (), Move Down (), and Delete () toolbar buttons to organize and remove commands from the list.
From the Output list, select an output data type: None (the default, for no output); String; Boolean; Integer; Double; or a 1D or 2D array type. For all output data types, you can enter a name for the method’s output in the Name field (default: out). The value of the output variable is what the method returns. If it is unassigned, the method returns the default value for the type (0, null, or false).