07.05.2015 Views

Download the documentation - True BASIC

Download the documentation - True BASIC

Download the documentation - True BASIC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Sorting and Searching Libraries 6<br />

Exceptions:<br />

See also:<br />

None<br />

CSORTS, SEARCHS, CSEARCHN, CSORTN<br />

CSORTN Subroutine<br />

Library:<br />

Syntax:<br />

numarrarg::<br />

Usage:<br />

Summary:<br />

Details:<br />

Example:<br />

SORTLIB.TRC<br />

CALL CSORTN (numarrarg)<br />

numarr<br />

numarr bowlegs<br />

CALL CSORTN (array())<br />

Sorts <strong>the</strong> specified numeric array using <strong>the</strong> customized comparison routine named<br />

CompareN.<br />

The CSORTN subroutine sorts <strong>the</strong> elements of <strong>the</strong> specified numeric array into <strong>the</strong> order<br />

determined by a customized comparison subroutine.<br />

The SORTN subroutine compares elements based upon <strong>the</strong> b <strong>the</strong>n<br />

LET compflag = -1<br />

ELSEIF a = b <strong>the</strong>n<br />

LET compflag = 0<br />

ELSE<br />

LET compflag = 1<br />

END IF<br />

END SUB

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!