midrange.com code scratchpad |
Name:
CP1552R - sort compile-time array
|
Scriptlanguage:
Plain Text
|
Tabwidth:
4
|
Date:
10/03/2018 02:42:25 pm
|
IP:
Logged
|
|
Description:
The purpose of this program is to sort source files. Specifically, to sort compile time arrays (so that
%LookUp will can a binary search). Enter QS over the line number at the start and end of the lines to be
sorted. This program can either be specified in the registry or by user (using option 13 - Change session
defaults). This is an example. In real life, I don't use arrays because RPG won't let me define their length
at run time. For this example I am assuming a compile time array will never be larger than 512. Any number
up to a million will work, and, considering that source files have limits (~32k records) this program really
doesn't need a dynamically defined array.
|
Code:
|
|