SortArray

Prev Next Home Home Table Of Contents Index

SortArray (Array)

SortArray will do an alphabetical sort on an array of strings.


Example:
Sort a Text File:

Usage: DIR|MARXMENU SORT|MORE MARXMENU SORT INFILE OUTFILE

SORT.MNU var SortBuf StandardIO ReadTextFile (ParamStr(2),SortBuf) SortArray(SortBuf) WriteTextFile (ParamStr(3),SortBuf)

Example:
var List

List[1] = 'James' List[2] = 'Adam' List[3] = 'Kate' List[4] = 'Ben' List[5] = 'Don' ; the above creates the array List with 5 elements

SortArray(List) ; List is sorted Loop List ;Loop through List so as to display the elements Writeln LoopVal EndLoop

The result of this example is: Adam Ben Don James Kate

See Also: SortArrayLinked

Category: Array

Prev Next Home Home Table Of Contents Index

Sponsors
Shopping
Forum
Forum
email
EMail
Index
Index
Home
Home