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
  • Deleting the last element
  • Miscellaneous
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
Elimina un elemento en una posición determinada:
  • de un array WLanguage unidimensional.
  • de una propiedad array de un tipo avanzado (array de eventos de gglCalendar, etc.).
  • de un array asociativo.
  • de una lista WLanguage.
El tamaño del array se reduce automáticamente.
Observaciones:
  • Esta función es equivalente a la función ArrayDelete.
  • WEBDEV - Código NavegadorPHP Esta función solo se puede utilizar con variables de tipo Array y Associative array.
Ejemplo
MyArray is array of 2 strings
MyArray[1] = "WINDEV"
MyArray[2] = "WEBDEV"
// Delete the 1st element
Delete(MyArray, 1) // Deletes "WINDEV"
// Display the 1st element
Trace(MyArray[1])  // Displays "WEBDEV"
// Associative array Last Name - First Name
aaLastNameFirstName is associative array of strings
Insert(aaLastNameFirstName, "Smith", "Tommy")
Insert(aaLastNameFirstName, "Montgomery", "Julia")
Delete(aaLastNameFirstName, "Smith")
// Deletion during a browse
sLastName is string
sFirstName is string
FOR EACH ELEMENT sFirstName, sLastName OF aaLastNameFirstName
Trace(sFirstName + ":" + sLastName)
Delete(aaLastNameFirstName, CurrentElement)
END
Sintaxis

Eliminar un elemento de un array WLanguage o de una propiedad array de un tipo avanzado Ocultar los detalles

<Result> = Delete(<WLanguage array> , <Element index>)
<Result>: Integro
Number of deleted elements (always corresponds to 1).
<WLanguage array>: Array
Name of the Array variable to use. This array must be a one-dimensional array.
<Element index>: Integro
  • Index of the element to be deleted. A WLanguage error occurs if this parameter is greater than the number of array elements.
  • The following constants can be used:
    CurrentElementThe current element is deleted. This constant is used to delete the current element during a FOR EACH browse.
    This constant is only available for associative arrays.
    FirstElementThe first array element is deleted.

Eliminar un elemento de un array asociativo Ocultar los detalles

<Result> = Delete(<WLanguage array> , <Element key>)
<Result>: Integro
Number of deleted elements:
  • 1 or 0 for the associative arrays without duplicates.
  • 0 to N for the associative arrays with duplicates.
<WLanguage array>: Array asociativo
Name of the Associative Array variable to use.
<Element key>: Integro
  • Value of key corresponding to the element to delete.
    • In an associative array without duplicates If the element exists, it is deleted; if the element does not exist, no operation is performed.
    • In an associative array with duplicates: If the element exists, all the <Element key> elements are removed; if the element does not exist, no operation is performed.
  • This parameter can also correspond to the CurrentElement constant. This syntax is used to delete the current element during a FOR EACH browse.
WEBDEV - Código NavegadorPHP No disponible en código de navegador y en PHP

Eliminar un elemento de una variable de tipo List Ocultar los detalles

<Result> = Delete(<WLanguage list> , <Element index>)
<Result>: Integro
Number of deleted elements (1 for the lists).
<WLanguage list>: Lista
Name of List variable to use.
<Element index>: Constante de tipo Integer
Index of the list where the element will be deleted. The following constants can be used:
CurrentElementThe current element is deleted. For a list, this constant is available when browsing the list elements (during a FOR EACH browse).
FirstElementThe first element found in the list is deleted.
LastElementThe last element found in the list is deleted.
Observaciones

Deleting the last element

If the last element is deleted, the array is resized to 0. The array is not freed: new additions can be made without reallocating the array.

Miscellaneous

This function cannot be used with the fixed arrays.
Componente: wd300vm.dll
Versión mínima requerida
  • Versión 14
Esta página también está disponible para…
Comentarios
Exemplo Delete
// Exemplo Delete
tabListanumeros is array of 0 int
ArrayAddLine(tabListanumeros,10)
ArrayAddLine(tabListanumeros,5)
ArrayAddLine(tabListanumeros,3)
ArrayAddLine(tabListanumeros,1)
EDT_Texto = ArrayToString(tabListanumeros)

//Eliminar uma linha

Delete(tabListanumeros,EDT_LinhaEliminar)

EDT_resultado = ArrayToString(tabListanumeros)

http://windevdesenvolvimento.blogspot.com.br/2016/12/aula-995-windev-array-007-delete.html

https://www.youtube.com/watch?v=n_mMH9khOr4
De matos
13 12 2016

Última modificación: 24/09/2024

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