ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV and WINDEV Mobile 2024 feature!
Help / WLanguage / WLanguage functions / Standard functions / Queue, stack, list and array functions / Array functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
ArrayToParameters (Function)
In french: TableauVersParamètres
Converts an array of elements into a list of parameters.
Example
PROCEDURE InterpretCommandLine(arguments is array of strings = [])
// The first row of the array contains the parameter type ("string" or "int")
// The following rows contain the parameters
// to be passed to the procedure that processes the elements of the command line

// Extract type of command to be executed
MyCommand is string = arguments[1]
ArrayDelete(arguments, FirstElement)

// Execute a procedure according to the parameter type
// The remaining elements of the array are transformed into a list of parameters expected by the procedure
SWITCH MyCommand
CASE "string"
MyCommandString(ArrayToParameters(arguments))
CASE "int"
MyCommandInteger(ArrayToParameters(arguments))
OTHER CASE
Trace(MyCommand + " does not exist.")
END
// Procedure for strings
PROCEDURE MyCommandString(s1 is string, s2 is string)
Trace("s1=" +s1 + " | s2 = " + s2)
// Procedure for integers
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
Component: wd290vm.dll
Minimum version required
  • Version 2024
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/07/2024

Send a report | Local help