OldSortDirDefs:
DEFINITIONS = {
ROPE: TYPE = Rope.ROPE;
STREAM: TYPE = IO.STREAM;
CallerNumber: TYPE = [0..200);
CP: TYPE = RECORD [name, phone: ROPE, recruiter: CallerNumber];
Handle: TYPE = REF MyRec; -- a REF to the data for a particular instance of the sample tool; multiple instances can be created.
MyRec:
TYPE =
RECORD [
-- the data for a particular tool instance
outer: Containers.Container ← NIL, -- handle for the enclosing container
height: CARDINAL ← 0, -- height measured from the top of the container
cmd: CommandViewer, -- the commands
in: IO.STREAM, eof: BOOLEAN ← FALSE,
out: IO.STREAM,
item: EntrySeq,
tsIn, tsOut: STREAM,
zip: REF BOOL,
ts: ViewerClasses.Viewer ]; -- the typescript
nLines: NAT = 5;
SmallCount: TYPE = [0..nLines);
Entry:
TYPE =
RECORD [
phone: ARRAY SmallCount OF ROPE ← ALL[NIL],
name: ARRAY SmallCount OF ROPE ← ALL[NIL],
addr: ARRAY SmallCount OF ROPE ← ALL[NIL],
town: ROPE ← NIL,
zip: ROPE ← NIL,
extracted for use by sort comparison
cname: ROPE, -- cannonical form name
zipNumber: LONG CARDINAL
];
EntrySeqBody: TYPE = RECORD [count: CARDINAL ← 0, e: SEQUENCE max: CARDINAL OF REF Entry];
EntrySeq:
TYPE =
REF EntrySeqBody;
CommandViewer:
TYPE =
RECORD [
inputFile, outputFile, workingDir: ViewerClasses.Viewer
];
CompareProc: PROC [h: Handle, r1, r2: REF Entry] RETURNS [Basics.Comparison];
Quit: PROC [handle: Handle, reason: ROPE ← NIL];
Quit2: PROC [handle: Handle, st: IO.STREAM, reason: ROPE ← NIL];
}.