Procedure FileChangeFirstWord(FileName:String;W1,W2:Word);
var
fs: TFileStream;
I:LongWord;
W:Word;
begin
fs := TFileStream.Create(FileName, fmOpenReadWrite or fmShareDenyNone);
try
For I:=0 To (fs.Size Div 2)-1 Do
Begin
//fs.Seek(I, soFromBeginning);
fs.Position:=I;
fs.ReadBuffer(W,2);
If W=W1 then
Begin
fs.Position:=I;
fs.WriteBuffer(W2,2);
Exit;
End;
End;
finally
fs.free;
end;
end;



سلام
چرا برنامه به خط TFileStream.Create گیر میده.
آیا استفاده از fs.Position به جای seek اشکال داره؟
و وقتی Exit اجرا میشه فایل بسته خواهد شد؟

کسی میتونه کد درست رو برام بذاره؟