PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Deletes the duplicates from an array.
The following arrays can be handled:
  • One-dimensional array of simple elements.
  • Two-dimensional array of simple elements. The deletion of duplicates is performed according to the value of one or more columns.
  • One-dimensional array of classes or structures. The deletion of duplicates is performed according to the value of one or more members.
  • One-dimensional array by providing a comparison procedure.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
WEBDEV - Browser code This function is now available in browser code.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
WEBDEV - Browser code This function is now available in browser code.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
WEBDEV - Browser code This function is now available in browser code.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
arrMyArray is array of int = [ 1, 2, 3, 1, 4, 5, 2, 6 ]
// arrMyArray contains [ 1, 2, 3, 1, 4, 5, 2, 6 ]

ArrayDeleteDuplicate(arrMyArray)
// arrMyArray contains [ 1, 2, 3, 4, 5, 6 ]
// Use with an array of structures
StACategory is Structure
CODE_CATEGORY is string(5)
CATEGORY is string(300)
END
arrTheCategories is array of StACategory

// Code for filling the array
...

// Delete the duplicates
ArrayDeleteDuplicate(arrTheCategories, asMember, "CODE_CATEGORY;CATEGORY")
Syntax

Deleting the duplicates from a one-dimensional array of simple elements Hide the details

ArrayDeleteDuplicate(<Array Name> [, <Deletion Options>])
<Array Name>: Array
Name of 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>: Optional integer constant
Versions 17 and later
Deletion options corresponding to one or more constants:
tccIgnoreAccentDelete the duplicates while ignoring the accented characters.
This option is useful for the arrays of character strings.
WEBDEV - Browser code This constant is not available.
tccIgnoreCaseDelete the duplicates while ignoring the case.
This option is useful for the arrays of character strings.
tccIgnoreSpaceDelete the duplicates while ignoring the space characters found at the beginning and at the end of strings.
This option is useful for the arrays of character strings.
Versions 20 and later
tccIgnoreInsideSpace
New in version 20
tccIgnoreInsideSpace
tccIgnoreInsideSpace
Delete the duplicates while ignoring the space characters found inside the strings.
This option is useful for the arrays of character strings.
tccIgnorePonctuationAndSpaceDelete the duplicates while ignoring the space characters and the punctuation characters.
This option is useful for the arrays of character strings.
WEBDEV - Browser code This constant is not available.
New in version 17
Deletion options corresponding to one or more constants:
tccIgnoreAccentDelete the duplicates while ignoring the accented characters.
This option is useful for the arrays of character strings.
WEBDEV - Browser code This constant is not available.
tccIgnoreCaseDelete the duplicates while ignoring the case.
This option is useful for the arrays of character strings.
tccIgnoreSpaceDelete the duplicates while ignoring the space characters found at the beginning and at the end of strings.
This option is useful for the arrays of character strings.
Versions 20 and later
tccIgnoreInsideSpace
New in version 20
tccIgnoreInsideSpace
tccIgnoreInsideSpace
Delete the duplicates while ignoring the space characters found inside the strings.
This option is useful for the arrays of character strings.
tccIgnorePonctuationAndSpaceDelete the duplicates while ignoring the space characters and the punctuation characters.
This option is useful for the arrays of character strings.
WEBDEV - Browser code This constant is not available.
Deletion options corresponding to one or more constants:
tccIgnoreAccentDelete the duplicates while ignoring the accented characters.
This option is useful for the arrays of character strings.
WEBDEV - Browser code This constant is not available.
tccIgnoreCaseDelete the duplicates while ignoring the case.
This option is useful for the arrays of character strings.
tccIgnoreSpaceDelete the duplicates while ignoring the space characters found at the beginning and at the end of strings.
This option is useful for the arrays of character strings.
Versions 20 and later
tccIgnoreInsideSpace
New in version 20
tccIgnoreInsideSpace
tccIgnoreInsideSpace
Delete the duplicates while ignoring the space characters found inside the strings.
This option is useful for the arrays of character strings.
tccIgnorePonctuationAndSpaceDelete the duplicates while ignoring the space characters and the punctuation characters.
This option is useful for the arrays of character strings.
WEBDEV - Browser code This constant is not available.

Deleting the duplicates from a two-dimensional array of simple elements according to one or more columns Hide the details

ArrayDeleteDuplicate(<Array Name> , <asColumn> , <Column>)
<Array Name>: Array
Name of Array variable to use. This array must be a two-dimensional array.
This array can also correspond to a two-dimensional array of advanced type (deleting duplicates from an xlsDocument variable according to the column value for example).
<asColumn>: Constant
asColumn: Constant used to handle a two-dimensional array of simple elements according to several columns.
Versions 17 and later
The asColumn constant can be combined with one or more options for deletion:
tccIgnoreAccentDelete the duplicates while ignoring the accented characters.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
WEBDEV - Browser code This constant is not available.
tccIgnoreCaseDelete the duplicates while ignoring the case.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
tccIgnoreSpaceDelete the duplicates while ignoring the space characters found at the beginning and at the end of strings.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
Versions 20 and later
tccIgnoreInsideSpace
New in version 20
tccIgnoreInsideSpace
tccIgnoreInsideSpace
Delete the duplicates while ignoring the space characters found inside the strings.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
tccIgnorePonctuationAndSpaceDelete the duplicates while ignoring the space characters and the punctuation characters.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
WEBDEV - Browser code This constant is not available.
New in version 17
The asColumn constant can be combined with one or more options for deletion:
tccIgnoreAccentDelete the duplicates while ignoring the accented characters.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
WEBDEV - Browser code This constant is not available.
tccIgnoreCaseDelete the duplicates while ignoring the case.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
tccIgnoreSpaceDelete the duplicates while ignoring the space characters found at the beginning and at the end of strings.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
Versions 20 and later
tccIgnoreInsideSpace
New in version 20
tccIgnoreInsideSpace
tccIgnoreInsideSpace
Delete the duplicates while ignoring the space characters found inside the strings.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
tccIgnorePonctuationAndSpaceDelete the duplicates while ignoring the space characters and the punctuation characters.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
WEBDEV - Browser code This constant is not available.
The asColumn constant can be combined with one or more options for deletion:
tccIgnoreAccentDelete the duplicates while ignoring the accented characters.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
WEBDEV - Browser code This constant is not available.
tccIgnoreCaseDelete the duplicates while ignoring the case.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
tccIgnoreSpaceDelete the duplicates while ignoring the space characters found at the beginning and at the end of strings.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
Versions 20 and later
tccIgnoreInsideSpace
New in version 20
tccIgnoreInsideSpace
tccIgnoreInsideSpace
Delete the duplicates while ignoring the space characters found inside the strings.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
tccIgnorePonctuationAndSpaceDelete the duplicates while ignoring the space characters and the punctuation characters.
This option is applied to all the columns according to which the deletion of duplicates is performed.
This option is useful for the arrays of character strings.
WEBDEV - Browser code This constant is not available.
<Column>: Integer or character string
  • If a single column must be taken into account, subscript of the column that must be taken into account for the deletion of duplicates.
  • If several columns must be taken into account, list of columns that must be taken into account for the deletion of duplicates. The different columns must be separated by a semicolon.

Deleting the duplicates from a one-dimensional array of classes, structures or advanced types Hide the details

ArrayDeleteDuplicate(<Array Name> , <asMember> , <Members>)
<Array Name>: Array
Name of Array variable to use. This array must be a one-dimensional array. This array can be an array of classes, structures or advanced types.
<asMember>: Constant
asMember: Constant used to handle a one-dimensional array of classes, structures or advanced types.
Versions 17 and later
The asMember constant can be combined with one or more options for deletion:
tccIgnoreAccentDelete the duplicates while ignoring the accented characters.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
WEBDEV - Browser code This constant is not available.
tccIgnoreCaseDelete the duplicates while ignoring the case.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
tccIgnoreSpaceDelete the duplicates while ignoring the space characters found at the beginning and at the end of strings.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
Versions 20 and later
tccIgnoreInsideSpace
New in version 20
tccIgnoreInsideSpace
tccIgnoreInsideSpace
Delete the duplicates while ignoring the space characters found inside the strings.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
tccIgnorePonctuationAndSpaceDelete the duplicates while ignoring the space characters and the punctuation characters.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
WEBDEV - Browser code This constant is not available.
New in version 17
The asMember constant can be combined with one or more options for deletion:
tccIgnoreAccentDelete the duplicates while ignoring the accented characters.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
WEBDEV - Browser code This constant is not available.
tccIgnoreCaseDelete the duplicates while ignoring the case.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
tccIgnoreSpaceDelete the duplicates while ignoring the space characters found at the beginning and at the end of strings.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
Versions 20 and later
tccIgnoreInsideSpace
New in version 20
tccIgnoreInsideSpace
tccIgnoreInsideSpace
Delete the duplicates while ignoring the space characters found inside the strings.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
tccIgnorePonctuationAndSpaceDelete the duplicates while ignoring the space characters and the punctuation characters.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
WEBDEV - Browser code This constant is not available.
The asMember constant can be combined with one or more options for deletion:
tccIgnoreAccentDelete the duplicates while ignoring the accented characters.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
WEBDEV - Browser code This constant is not available.
tccIgnoreCaseDelete the duplicates while ignoring the case.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
tccIgnoreSpaceDelete the duplicates while ignoring the space characters found at the beginning and at the end of strings.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
Versions 20 and later
tccIgnoreInsideSpace
New in version 20
tccIgnoreInsideSpace
tccIgnoreInsideSpace
Delete the duplicates while ignoring the space characters found inside the strings.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
tccIgnorePonctuationAndSpaceDelete the duplicates while ignoring the space characters and the punctuation characters.
This option is applied to all the members according to which the deletion of duplicates is performed.
This option is useful for the "character string" members.
WEBDEV - Browser code This constant is not available.
<Members>: Character string
Name of members used. If the deletion of duplicates is performed according to the value of several members, their names must be separated by semicolons.

Deleting the duplicates from a one-dimensional array with a sort procedure Hide the details

ArrayDeleteDuplicate(<Array Name> , <asFunction> , <Custom WLanguage Procedure>)
<Array Name>: Array
Name of Array variable to use. This array must be a one-dimensional array.
This array can be an array of advanced types.
<asFunction>: Constant
asFunction: Constant used to handle a one-dimensional array with a sort procedure.
<Custom WLanguage Procedure>: Character string (with or without quotes)
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 the element 1 and the element 2 are identical, the procedure must return 0.
Remarks
  • 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 a custom deletion (with a WLanguage procedure) can be used.
  • This function cannot be used with the arrays of UNICODE strings.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
WEBDEV - Browser code WDJS.DLL
Linux wd230vm.so
Minimum required version
  • Version 16
This page is also available for…
Comments
Exemplo ArrayDeleteDuplicate
// Vou mostrar como eliminar itens duplos no array

tabListanumeros is array of 0 int
ArrayAddLine(tabListanumeros,10)
ArrayAddLine(tabListanumeros,10)
ArrayAddLine(tabListanumeros,5)
ArrayAddLine(tabListanumeros,5)
ArrayAddLine(tabListanumeros,3)
ArrayAddLine(tabListanumeros,3)
EDT_Texto = ArrayToString(tabListanumeros)
//http://doc.windev.com/en-US/?1000019422&name=arraydeleteduplicate_function
// Elimina os Duplos no Array
ArrayDeleteDuplicate(tabListanumeros)
EDT_resultado = ArrayToString(tabListanumeros)
//Antes
//10
//10
//5
//5
//3
//3
//Depois
//10
//5
//3

// Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/12/aula-994-windev-array-006.html
https://www.youtube.com/watch?v=s8BfjdlV13g
De matos
Dec. 13 2016