ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Queue, stack, list and array functions / Array functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
ArrayToCSV (Function)
In french: TableauVersCSV
Converts a one-dimensional array or a two-dimensional array into a character string in CSV format.
Note: This function can only be used on WLanguage arrays.
Example
// Tableau à une dimension
sMesValeurs is string 
// Tableau initial
MonTableau is array of 3 strings
MonTableau[1] = "A"
MonTableau[2] = "B"
MonTableau[3] = "C"
sMesValeurs = ArrayToCSV(MonTableau)
// sMesValeurs contient : "A" + RC + "B" + RC + "C"
// Tableau à deux dimensions
sMesValeurs is string 
// Tableau initial
MonTableau is array of 2 by 3 strings
MonTableau[1,1] = "A"; MonTableau[1,2] = "B"
MonTableau[1,3] = "C"; MonTableau[2,1] = "D"
MonTableau[2,2] = "E"; MonTableau[2,3] = "F"

sMesValeurs = ArrayToCSV(MonTableau)
// sMesValeurs contient : "A;B;C"+RC+"D;E;F"
Syntax
<Result> = ArrayToCSV(<WLanguage array> [, <Column separator>])
<Result>: Character string
Character string containing the different values found in the array.
For a one-dimensional array, the array elements are converted into character string and added into the string while being separated by CR characters (Carriage Return).
For a two-dimensional array, the array elements are converted into character string and added into the string. The rows are separated by CR characters (Carriage Return) and the columns are separated by <Column separator>.
<WLanguage array>: Array variable
Name of one-dimensional or two-dimensional array that will be converted into character string. This array must be created.
<Column separator>: Optional character string
Separator used to separate the values of different columns. The column separator used by default is ";".
Remarks
  • The separator used in the <Result> to separates the values found on different lines is CR (Carriage Return).
  • The structure arrays supported are the one-dimensional arrays only.
  • The arrays containing UNICODE strings or variants are not supported.
  • For the Duration type, the value is converted into thousands of a second.
Component: wd300vm.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help