|
|
|
|
ArrayToParameters (Function) In french: TableauVersParamètres Converts an array of elements into a list of parameters.
PROCEDURE InterpretCommandLine(arguments is array of strings = [])
MyCommand is string = arguments[1]
ArrayDelete(arguments, FirstElement)
SWITCH MyCommand
CASE "string"
MyCommandString(ArrayToParameters(arguments))
CASE "int"
MyCommandInteger(ArrayToParameters(arguments))
OTHER CASE
Trace(MyCommand + " does not exist.")
END
PROCEDURE MyCommandString(s1 is string, s2 is string)
Trace("s1=" +s1 + " | s2 = " + s2)
PROCEDURE MyCommandInteger(n1 is int, n2 is int)
Trace("n1=" + n1 + " | n2 = " + n2)
Syntax
(<Parameter 1>, <Parameter N>) = ArrayToParameters(<Array of parameters>)
<Parameter 1>: Type of parameter First parameter extracted from the array of parameters. <Parameter N>: Type of parameter Last parameter extracted from the array of parameters. <Array of parameters>: Array Array containing all the values to be passed as parameters to a function or procedure. Remarks - An error is raised if an unexpected parameter type is passed to the function/procedure (e.g., int instead of string).
- The array of parameters can be an array of int, strings, variants, etc. All types are supported.
- You can directly get the different parameters. For example:
arguments is array of strings = ["Value1", "Value2"]
s1 is string
s2 is string
(s1, s2) = ArrayToParameters(arguments)
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|