PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Adding an element
  • Various
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
Adds an element into a one-dimensional array while taking into account the sort criterion defined by ArraySort.
Note: This function can only be used on the 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 the 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 the 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 the 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.
Example
MyArray is array of 2 strings
MyArray[1] = "WINDEV"
MyArray[2] = "WEBDEV"
ArraySort(MyArray, asAscending)
ArrayAddSorted(MyArray, "WEBDEV and WINDEV")
// Display the content of elements
Trace(MyArray[1]) // Displays "WEBDEV"
Trace(MyArray[2]) // Displays "WEBDEV and WINDEV"
Trace(MyArray[3]) // Displays "WINDEV"
Syntax
<Result> = ArrayAddSorted(<Array Name> , <Element Value>)
<Result>: Integer
Subscript where the specified element was added, -1 if the element was not added.
A WLanguage error occurs if:
  • no sort criterion was defined (ArraySort).
  • the sort criterion was not respected by the array before the addition.
<Array Name>: Array
Name of 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 ArrayAddSorted:
  • 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.

Various

This function cannot be used on:
  • the non-allocated arrays,
  • the fixed arrays.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
WEBDEV - Browser code WDJS.DLL
Linux wd230vm.so
Minimum required version
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment