program rwdisket; { makes a read / write test on a diskette } type rec = record data : string[128] end; str = string[75]; str128 = string[128]; var testfile : file of rec; testrec : rec; i, result : integer; instr : str128; ch : char; ok : boolean; begin clrscr; write('Write testdata to an erased diskette...(Y)'); with testrec do begin data := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567899876543210abcdefghijklmnopqrstuvwxyz!@#$%^&*()-_+=<>,.?/|\~":][ABCDEFGHIJKLMNOPQRSTUVWX' +'YZ12'; instr := testrec.data; end; read(kbd,ch); if upcase(ch) ='Y' then begin assign(testfile,'test.dta'); rewrite(testfile); with testrec do instr := data; FOR I := 1 TO 2800 DO write(testfile,testrec); close(testfile) ; end; writeln; write('Verifying... '); assign(testfile,'test.dta'); reset(testfile); repeat with testrec do begin read(testfile, testrec); if instr = data then ok := true else ok := false end; write('*') until eof(testfile) or not ok; writeln; if ok then begin erase(testfile); writeln('all ok...') end else writeln('Some bad data found...') end.