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
Deletes the duplicates from an array.
The following arrays can be handled:
  • One-dimensional array of simple elements.
  • Two-dimensional array of simple elements. Duplicates are deleted according to the value of one or more columns.
  • One-dimensional array of classes or structures. Duplicates are deleted according to the value of one or more members.
  • One-dimensional array by providing a comparison procedure.
Note: The <Array>.Distinct function is used to obtain a new array without duplicates.
Ejemplo
tabMonTableau is array of int = [ 1, 2, 3, 1, 4, 5, 2, 6 ]
// tabMonTableau contient [ 1, 2, 3, 1, 4, 5, 2, 6 ]

tabMonTableau.DeleteDuplicate()
// tabMonTableau contient [ 1, 2, 3, 4, 5, 6 ]
// Utilisation avec un tableau de structures
stUneCatégorie is Structure
	CODE_CATEGORIE is string(5)
	CATEGORIE is string(300)
END
tabLesCatégories is array of stUneCatégorie

// Code de remplissage du tableau
...

// Suppression des doublons
tabLesCatégories.DeleteDuplicate(asMember, "CODE_CATEGORIE;CATEGORIE")
Sintaxis

Eliminar los duplicados de un array unidimensional de elementos simples Ocultar los detalles

<WLanguage array>.DeleteDuplicate([<Deletion options>])
<WLanguage array>: Array
Name of the Array variable to use. This array must be a one-dimensional array.
This array can also correspond to an array of simple elements of an advanced variable ("Group" array in the gglContact variables for example).
<Deletion options>: Constante opcional de tipo Integer
Deletion options corresponding to one or more constants:
tccIgnoreAccentDelete duplicates ignoring accents.
This option is useful for arrays of strings.
tccIgnoreCaseDelete duplicates ignoring case.
This option is useful for arrays of strings.
tccIgnoreInsideSpaceDelete duplicates ignoring spaces inside strings.
This option is useful for arrays of strings.
tccIgnorePunctuationAndSpaceDelete duplicates ignoring spaces and punctuation.
This option is useful for arrays of strings.
tccIgnoreSpaceDelete duplicates ignoring the spaces at the beginning and at the end of strings.
This option is useful for arrays of strings.

Eliminación de duplicados en un array unidimensional con un procedimiento de comparación Ocultar los detalles

<WLanguage array>.DeleteDuplicate(<asFunction> , <Custom WLanguage procedure>)
<WLanguage array>: Array
Name of the Array variable to use. This array must be a one-dimensional array.
This array can be an array of advanced types.
<asFunction>: Constante
ttFunction: Constant used to manipulate a one-dimensional array with a sorting procedure.
<Custom WLanguage procedure>: Cadena de caracteres
WLanguage procedure in the following format:
PROCEDURE <Procedure name>(<Element1>, <Element2>)
This procedure is automatically called by the deletion mechanism to compare the elements between themselves, two by two.
  • If the element 1 must be found before the element 2 in the sort order, the procedure must return -1.
  • If the element 1 must be found after the element 2 in the sort order, the procedure must return 1.
  • If element 1 and element 2 are identical, the procedure must return 0.
Observaciones
  • This function is not available for the fixed arrays.
  • This function can be used on the arrays of advanced variables.
  • Dynamic array of variants: Only custom deletion (with a WLanguage procedure) can be used.
Componente: wd300vm.dll
Versión mínima requerida
  • Versión 23
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 30/09/2024

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