PC SOFT

AYUDA EN LÍNEA
DE WINDEV, WEBDEV Y WINDEV MOBILE

  • Adding a row into a WLanguage array
  • Adding a row into an advanced array property
  • Miscellaneous
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Otros
Procedimientos almacenados
ArrayAddLine (Function)
 
Adds a row at the end:
  • of a one- or two-dimensional WLanguage array.
  • of an advanced two-dimensional array property (xlsDocument, ...).
Note: This function is identical to AddLine.
Versiones 18 y posteriores
Universal Windows 10 App This function is now available in Windows Store apps mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
Nueva funcionalidad versión 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
Universal Windows 10 App This function is now available in Windows Store apps mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versiones 21 y posteriores
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WEBDEV - Código Navegador This function is now available in browser code.
Nueva funcionalidad versión 21
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WEBDEV - Código Navegador This function is now available in browser code.
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WEBDEV - Código Navegador This function is now available in browser code.
Versiones 22 y posteriores
Widget Android This function is now available in Android Widget mode.
Android This function is now available for Android applications.
Java This function is now available for the Java applications.
Nueva funcionalidad versión 22
Widget Android This function is now available in Android Widget mode.
Android This function is now available for Android applications.
Java This function is now available for the Java applications.
Widget Android This function is now available in Android Widget mode.
Android This function is now available for Android applications.
Java This function is now available for the Java applications.
Ejemplo
MyArray is array of 2 by 3 strings
ArrayAddLine(MyArray, "A", "B", "C")
ArrayAddLine(MyArray, "a", "b", "c")
ArrayAddLine(MyArray, "D", "E", "F")
// Display the content of the 3rd row (the two first rows are empty)
Trace(MyArray[3,1], MyArray[3,2], MyArray[3,3])
// Displays "A B C"
MyArray is array of 2 by 3 strings
MyArray[1,1] = "A"
MyArray[1,2] = "B"
MyArray[1,3] = "C"
MyArray[2,1] = "a"
MyArray[2,2] = "b"
MyArray[2,3] = "c"
ArrayAddLine(MyArray, "D", "E", "F")
// Display the content of the 3rd row
Trace(MyArray[3,1], MyArray[3,2], MyArray[3,3])
// Displays "D E F"
Sintaxis
<Result> = ArrayAddLine(<WLanguage array> [, <Element column 1> [... [, <Element column N>]]])
<Result>: Integer
  • Subscript of added row,
  • -1 if an error occurred.
<WLanguage array>: Array
Name of Array variable to use. This array must be a one-dimensional array or a two-dimensional array.
<Element column 1>: Type of array elements, optional
Element of the row that will be added into the specified array. Each element corresponds to a column in the array. The type of the added element must be compatible with the type of relevant column.
If none of these parameters is specified, an empty row is added to the array. The columns are initialized with the default value of the type of the other array elements.
If one of these parameters is not specified, the corresponding column is initialized with the default value of the type of the other array elements.
<Element column N>: Type of array elements, optional
Element of the row that will be added into the specified array. Each element corresponds to a column in the array. The type of the added element must be compatible with the type of relevant column.
If none of these parameters is specified, an empty row is added to the array. The columns are initialized with the default value of the type of the other array elements.
If one of these parameters is not specified, the corresponding column is initialized with the default value of the type of the other array elements.
Observaciones

Adding a row into a WLanguage array

When using ArrayAddLine:
  • the number of rows in the array is automatically increased to include the new row.
  • the number of columns in the array is not increased. You must:
    • declare the array with the proper number of columns (second dimension of the array).
    • dynamically modify the number of columns with Dimension.
  • the elements are converted (if necessary) into the type of the other array elements.
Note: When declaring an array of N by M elements, this array contains N empty rows. For example, the array declared below contains 3 empty rows.
MyArray is array of 3 by 2 strings
When adding a row (ArrayAddLine), this row is automatically added after the rows already found in the array.
In our example, the added row corresponds to the 4th row.

Adding a row into an advanced array property

When using ArrayAddLine:
  • the advanced variable must be allocated.
  • the advanced type must have an enumerator of modifiable collection type.
  • the advanced type is automatically enlarged to receive the new row.

Miscellaneous

  • This function cannot be used on:
    • non-created arrays.
    • fixed arrays.
  • To add a row at a given position, use ArrayInsertLine or Insert.
Componente : wd250vm.dll
Versión mínima requerida
  • Versión 10
Esta página también está disponible para…
Comentarios
ARRAY APRENDENDO
arr_empresas_codigo is array of int
FOR EACH empresa
ArrayAddLine(arr_empresas_codigo,empresa.empresaID)
END
ArraySort(arr_empresas_codigo,asDescending)
FOR x=1 TO ArrayCount(arr_empresas_codigo)
Trace(arr_empresas_codigo[x])
END

// BLOG COM VIDEO E EXEMPLO

https://www.patreon.com/amarildoMatos

http://windevdesenvolvimento.blogspot.com.br/2017/08/aula-1229-windev-array-012.html

https://www.youtube.com/watch?v=Q45aKjRK8uk


De matos
02 08 2017
Exemplo Array
tabListanumeros is array of 0 int
ArrayAddLine(tabListanumeros,10)
ArrayAddLine(tabListanumeros,5)
ArrayAddLine(tabListanumeros,2)
ArrayAddLine(tabListanumeros,20)
ArraySort(tabListanumeros,asAscending)
FOR x=1 TO ArrayCount(tabListanumeros)
SAI_array+=tabListanumeros[x]+CR
END
//Frances
tabListanumeros_f est tableau de 0 entier
TableauAjouteLigne(tabListanumeros_f,10)
TableauAjouteLigne(tabListanumeros_f,5)
TableauAjouteLigne(tabListanumeros_f,2)
TableauAjouteLigne(tabListanumeros_f,20)
TableauTrie(tabListanumeros_f,ttCroissant)
POUR x=1 A TableauOccurrence(tabListanumeros_f)
SAI_array+=tabListanumeros_f[x]+RC
FIN

//Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/02/curso-windev-array-001.html
De matos AMARILDO
18 02 2016