PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Adding an element
  • Miscellaneous
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 to a one-dimensional WLanguage array taking into account the sort criterion defined by <Array variable>.Sort.
Remark: This function can only be used on the WLanguage arrays.
Versions 21 and later
WEBDEV - Browser code This function is now available in browser code.
New in version 21
WEBDEV - Browser code This function is now available in browser code.
WEBDEV - Browser code This function is now available in browser code.
Example
MyArray is array of 2 strings
MyArray[1] = "WINDEV"
MyArray[2] = "WEBDEV"
MyArray.Sort(asAscending)
MyArray.AddSorted("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> = <WLanguage array>.AddSorted(<Element value>)
<Result>: Integer
  • Subscript at which the specified element was added,
  • -1 if the element could not be placed.
A WLanguage error occurs if:
  • no sort criterion was defined (<Array variable>.Sort).
  • the sort criterion was not respected by the array before the addition.
<WLanguage array>: 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 the function <Array variable>.AddSorted:
  • 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.
Component : wd250vm.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment