home *** CD-ROM | disk | FTP | other *** search
- program testdata; {generate test data}
-
- uses
- dos,crt,taccess,printer;
-
- TYPE
- OP_rec = record {data file for testing TACESS}
- state : byte;
- dummy : array[1..3] of byte;
- items : longint;
- crlf : array[1..2] of char;
- end;{IP_rec}
-
- VAR
- OP : file of OP_rec;
- Obuff : OP_rec;
- total : array[0..52] of longint;
- c : byte;
- d : longint;
- RecsPerState : integer;
-
- {***************************
- main
- ***************************}
- BEGIN
- assign(op,'testdata.new');
- rewrite(OP);
- fillchar(total,sizeof(total),0); {init totals}
- obuff.crlf[1] := #13;
- obuff.crlf[2] := #10;
- write('Enter # records per state =>');
- readln(RecsPerState);
- for c := 0 to 52 do begin
- obuff.state := c;
- for d := 1 to RecsPerState do begin {bug occurs when RecsPerState is large}
- obuff.items := d;
- write(op,obuff);
- total[c] := total[c] + d;
- end;
- end;
- close(OP);
- for c := 0 to 52 do
- writeln(lst,'state ',c,' total is ',total[c]:7);
- END.