ASortDirDefs:
DEFINITIONS = {
ROPE: TYPE = Rope.ROPE;
STREAM: TYPE = IO.STREAM;
CallerNumber: TYPE = [0..200);
CP: TYPE = RECORD [name, phone: ROPE, recruiter: CallerNumber];
CallerNameRec:
TYPE =
ARRAY CallerNumber
OF
CP;
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, in2: IO.STREAM, eof: BOOLEAN ← FALSE,
out: IO.STREAM,
item: EntrySeq,
secondary: EntrySeq,
callerNumber, recruiterNumber: REF BOOL,
address, zip, level, activity, dinner, age, phone, caller, recruiter, member: REF BOOL,
tsIn, tsOut: STREAM,
callerName: REF CallerNameRec,
dinnerOrder: PACKED ARRAY CHAR OF [0..16) ← ALL[0],
levelOrder: PACKED ARRAY CHAR OF [0..16) ← ALL[0],
activityOrder: PACKED ARRAY CHAR OF [0..16) ← ALL[0],
ageOrder: PACKED ARRAY CHAR OF [0..16) ← ALL[0],
ts: ViewerClasses.Viewer ]; -- the typescript
Entry:
TYPE =
RECORD [
phone: ARRAY [0..4) OF ROPE ← ALL[NIL],
name: ARRAY [0..4) OF ROPE ← ALL[NIL],
addr: ARRAY [0..4) OF ROPE ← ALL[NIL],
town: ROPE ← NIL,
zip: ROPE ← NIL,
extracted for use by sort comparison
cname: ROPE, -- cannonical form name
street: ROPE,
number: INT ← 0,
ctown: ROPE];
EntrySeqBody: TYPE = RECORD [count: CARDINAL ← 0, e: SEQUENCE max: CARDINAL OF REF Entry];
EntrySeq:
TYPE =
REF EntrySeqBody;
CommandViewer:
TYPE =
RECORD [
inputFile, outputFile, secondary, callers: 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];
}.