1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28:
| begin AssignFile(FromF, 'test.txt'); Reset(FromF, 2); repeat n := filePos(formF); / <-- pos merken BlockRead(FromF, Buf, SizeOf(Buf), NumRead); i1:=1; s2:=''; fehler:=0; count :=0; repeat s1:=buf[i1]; if (s1='') then fehler:=1; s2:=s2+s1; i1:= i1+1; until (i1>=1001); if (numread <> 0) and (fehler = 0) then begin substr :=s2; Seek(FormF, n);
BlockWrite(FromF, substr, SizeOf(Buf), NumRead); until (NumRead = 0); CloseFile(FromF); end; |