Custom Function Parameter Index Values:
Each Parameter used in a Custom Function is given an index value. Index values are given to each data-type that is passed into a Script-Object function. This ability allows different types of data can vary in each left to right placement of parameters.
Trading Blox Data Types:
•Numeric : Any Integer, Boolean (TRUE/FALSE), Selector, or Floating value.
•String: Any text value.
•Series: Any Auto-Index or Manual-Index Series
Within a Custom-Function it is easy to get how many parameters of each data-type are available by using one or all of the following Script-Object properties:
Example: |
|---|
' Count numeric parameters |
Each of the above script parameter properties will return how many Numeric, String, and Series (Auto-Index or Manual-Index) parameters were passed into the body of a Custom Function. Once it is known how many of each of data-type function is available each parameter can be accessed using their sequence location as their index value.
Sequence of each data-type is assigned a value of 1 for the left-most parameter of each data-type up to its parameter count value as the count moves to the right. This means each data-type will have a "1" value that increments to the count value of the right-most parameter of that data-type.
In this next example we have 3-numeric, 1-string, and 1-series parameters.
Example: |
|---|
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Method to Call the Execution of Custom Script from ' within the script area of the calling script section. ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Custom of a Mixed Parameter Function Example:
' ------------------------------------------------------- ' ------------------------------------------------------- ' ------------------------------------------------------- |
RETURN: |
Numeric Count: ,3 String Count: ,1 Series Count: ,1 |
Access to each of the passed parameters is available by using the access property for each data type and then using that data-type's index value location of where it is placed in the calling script list of parameters:
Parameter access: |
|---|
' Within Custom Function Body |
Edit Time: 10/29/2020 10:52:10 AM |
Topic ID#: 244 |