AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de colas, pilas, listas y arrays / Funciones de arrays
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Fills a one- or two-dimensional array of the specified type with the character string in CSV format passed as parameter. The array is cleared before it is filled.
Ejemplo
// One-dimensional array
sMyValues is string = "AT" + CR + "B" + CR + "C" + CR + "D" + CR + "D"
// Initial array
MyArray is array of 3 strings
MyArray[1] = "Y"
MyArray[2] = "X"
CSVToArray(sMyValues, MyArray)
// The array contains: "A" , "B" , "C" , "D" , "D".
// Two-dimensional array
sMyValues is string = "AT" + TAB + "B" + CR + "C" +TAB + "D" + CR + "E" + TAB + "F"
// Initial array
MyArray is array of 2 by 3 strings
MyArray[1,1] = "Y"
MyArray[1,2] = "Z"
CSVToArray(sMyValues, MyArray)
// The array contains: "A;B" , "C;D" E;F
Sintaxis
CSVToArray(<String> , <Array> [, <Column separator>])
<String>: Character string
Contains the different array elements.
For a one-dimensional array, the string will be cut according to the CR characters (Carriage Return).
For a two-dimensional array, the string will be cut according to the CR characters (Carriage Return), then according to the separator of columns. The elements will be added row by row. There will be as many rows as the number of CR characters found. Columns will be added if the maximum number of <Column separator> exceeds the number of columns in the array.
Each column must have a corresponding value for the row.
Warning: this parameter must not contain quotation marks..
<Array>: Array variable
Name of the one- or two-dimensional array where the elements found in the string must be added. This array must be allocated in a simple type or in a structure type.
<Column separator>: Optional character string
Separator used to separate the values of different columns. By default, the column separator used corresponds to "list separator" found in the regional settings of Windows.
Linux The separator is the semicolon ";".
Observaciones
  • The size of the array will be modified if necessary: rows and columns can be added according to the values contained in the <Chaîne>.
  • The structure arrays supported are the one-dimensional arrays only.
  • Arrays containing Unicode strings or variants are not managed.
  • For the Duration type, the value must be given in thousands of a second. The value 0 is not valid. You must use "0000000000".
Clasificación Lógica de negocio / UI: Código neutro
Componente: wd300vm.dll
Versión mínima requerida
  • Versión 12
Esta página también está disponible para…
Comentarios
Exemplo: LISTA DE IMPRESSORAS
PrintCtl = new PrintCtl

Csv_Resultado is Variant = PrintCtl.GetPrintersCollectionWlanguage()

//NAME;IS_DEFAULT;DRIVER_NAME;DEVICE_ID;IS_HIDDEN;PORT_NAME;STATUS;ERROR_MSG;

Array_Resultado is array of strings

CSVToArray(Csv_Resultado,Array_Resultado,";")

EXEMPLO NO REPOSITORIO
https://repository.windev.com/resource.awp?file_id=281474976711805;impressora-padrao-definir-impressora-padrao-windows-alterar-impressora-padrao-print-default-printdefault-getprinterdefau
Boller
25 02 2023

Última modificación: 27/03/2025

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