AddParameter

(Engine-Level Function)

Description: Adds an existing variable as a module parameter and returns the number of parameters in the module.
Warning: This function should be used only by advanced programmers.
Returns: Numeric... the number of parameters in a module.
Usage: Script Only.
Function Groups: Compilation and Online Modifications,  Advanced Module
Related to: ConstCount | NumParms | SetOneParmText | SetParameter | SetParmText | AddVariable
Format: AddParameter(Variable, Position)
Parameters:  
Variable
Required. Any expression that returns a variable value such as AddVariable(…).

This variable will become a parameter in the module where it is defined.
Position
Required. Any numeric expression giving the position in the parameter list where Variable will be inserted. Position 1 is the first parameter.
Inserting a variable past the end of the list will append the variable to the parameter list.
Comments

Seldom (if ever) used when adding features to modern VTScada applications.

The return value of AddParameter is the number of parameters in the module after the addition, or "-1" if it failed.
Caution: Attempting to insert a variable in the parameter list twice may result in undefined behavior.