PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Adding an element
  • Miscellaneous
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Adds an element to a one-dimensional WLanguage array taking into account:
  • the sort criteria defined by ArraySort
  • the comparison operator described in the class, if the elements of the array are class instances.
Remark: This function can only be used on WLanguage arrays.
Versions 18 and later
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.
New in version 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.
Versions 21 and later
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 - Browser code This function is now available in browser code.
New in version 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 - Browser code 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 - Browser code This function is now available in browser code.
Versions 27 and later
Java This function is now available for Java applications.
Android This function is now available for Android applications.
Android Widget This function is now available in Android Widget mode.
New in version 27
Java This function is now available for Java applications.
Android This function is now available for Android applications.
Android Widget This function is now available in Android Widget mode.
Java This function is now available for Java applications.
Android This function is now available for Android applications.
Android Widget This function is now available in Android Widget mode.
Example
MonTableau is array of 2 strings
MonTableau[1] = "WINDEV"
MonTableau[2] = "WEBDEV"
ArraySort(MonTableau, asAscending)
ArrayAddSorted(MonTableau, "WEBDEV et WINDEV")
// Afficher le contenu des éléments
Trace(MonTableau[1]) // Affiche "WEBDEV"
Trace(MonTableau[2]) // Affiche "WEBDEV et WINDEV"
Trace(MonTableau[3]) // Affiche "WINDEV"
Syntax
<Result> = ArrayAddSorted(<WLanguage array> , <Element value>)
<Result>: Integer
  • Index at which the specified element was added,
  • -1 if the element could not be added.
A WLanguage error occurs if:
  • no sort criteria have been defined (ArraySort function or comparison operator in the class).
  • the array did not meet the sort criteria before the addition.
<WLanguage array>: Array
Name of the Array variable to use. This array must be a one-dimensional array.
<Element value>: Type of array elements
Element that must be added to the specified array.
Remarks

Adding an element

When using the ArrayAddSorted function:
  • the array is automatically enlarged to receive the new element.
  • the element is converted (if necessary) into the type of the other array elements.
  • the element is placed in the array according to the sort.

Miscellaneous

This function cannot be used on:
  • non-created arrays,
  • fixed arrays.
Business / UI classification: Neutral code
Component: wd270vm.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment