dynSort()

Sorts a dynamic variable field in ascending or descending order.

Synopsis

int dynSort( dyn_type dynvar[, bool ascending = true]);

Parameters

Parameter Meaning
dynvar Variables to be sorted.
ascending

TRUE = dynamic field will be sorted in ascending order (default)

FALSE = dynamic field will be sorted in descending order

Return Value

Returns the length of the array (variable field) on success or -1 in case of an error.

Description

Sorts a dynamic variable field in ascending or descending order.

Example

main()
{
  dyn_int d_int = makeDynInt(10,30,15,12);
  dynSort(d_int, 0);
// desc
  DebugN(d_int);
}
/*
  OUTPUT:
  WCCOAui1:[dyn_int 4 items
  WCCOAui1: 1: 30
  WCCOAui1: 2: 15
  WCCOAui1: 3: 12
  WCCOAui1: 4: 10
*/

Assignment

Dynamic fields

Availability

CTRL