home *** CD-ROM | disk | FTP | other *** search
- unit SumPrint;
-
- interface
- uses Def, PG, RE, LPaU;
- procedure PrintSummary( PrintStack: BlockArray; PrintStackTop: integer);
-
- implementation
-
- procedure PrintSummary;
- var Counter,
- I: integer;
- TempEntry: MainRecordType;
- LastZip: S10;
- begin
- Counter := 0;
- PrintDevice;
- assign(OutPutDevice,Device);
- rewrite(OutPutDevice);
- GetRec(TempEntry,PrintStack[1]);
- LastZip := LPad(TempEntry.ZipCode,5);
- for I := 1 to PrintStackTop do
- begin
- GetRec(TempEntry,PrintStack[I]);
- if LastZip = LPad(TempEntry.ZipCode,5) then
- inc(Counter)
- else
- begin
- writeln(OutPutDevice,'Zip: ',LastZip,' Number = ',Counter:5);
- Counter := 1;
- LastZip := LPad(TempEntry.ZipCode,5);
- end;
- end;
- writeln(OutPutDevice,'Zip: ',LastZip,' Number = ',Counter:5);
- close(OutPutDevice);
- end;
-
- end.
-