AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

¡Nueva funcionalidad de WINDEV y WINDEV Mobile 2024!
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de colas, pilas, listas y arrays / Funciones de arrays
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Otros
Procedimientos almacenados
ArrayToParameters (Función)
Convierte un array de elementos en una lista de parámetros.
Ejemplo
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)
Sintaxis
(<Parameter 1>, <Parameter N>) = ArrayToParameters(<Array of parameters>)
<Parameter 1>: Tipo de parámetro
Primer parámetro extraído del array de parámetros.
<Parameter N>: Tipo de parámetro
Último parámetro extraído del array de parámetros.
<Array of parameters>: Array
Array que contiene los valores que se pasarán como parámetros a una función o procedimiento.
Observaciones
  • Si se pasa un tipo de parámetro inesperado a la función o procedimiento (por ejemplo, int en lugar de string), se produce un error.
  • El array de parámetros puede ser un array de int, strings, variants, etc. Se admiten todos los tipos.
  • Puede extraer directamente los diferentes parámetros. Por ejemplo:
    arguments is array of strings = ["Value1", "Value2"]
    s1 is string
    s2 is string
    (s1, s2) = ArrayToParameters(arguments)
Clasificación Lógica de negocio / UI: Lógica de negocio
Componente: wd290vm.dll
Versión mínima requerida
  • Versión 2024
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 07/03/2024

Señalar un error o enviar una sugerencia | Ayuda local