PosInSortedList

Prev Next Home Home Table Of Contents Index

PosInSortedList (String,Array) : Number

Scans a string array looking for a match on string in a sorted array and returns the array index of the first matched string if found or a zero if not found. The array must be in sorted order. A binary search is used to make this command very fast.


Example:
var List List[1] = 'Adam' List[2] = 'Ben' List[3] = 'Don' List[4] = 'James' List[5] = 'Kate' SortArray(List) ; List is sorted Writeln PosInSortedList('James',List) ;returns 4

See Also: PosInList PosInListLeft PosInListPartial

Category: Array

Prev Next Home Home Table Of Contents Index

Sponsors
Shopping
Forum
Forum
email
EMail
Index
Index
Home
Home