bok
unread,Jul 19, 2012, 2:10:02 PM7/19/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello,
The line below of "S:=Reversestring(S)" causes a file full of "nul" to be written instead of S. How do I manipulate S then correctly write the altered
string to n2.exe.
Thanks,
DBM
=========================================================
procedure TForm1.Button1Click(Sender: TObject);
var
readit,writeit: TFileStream;
s: string;
x:integer;
begin
readit := TFileStream.Create('n1.exe', fmOpenread);
writeit := TFileStream.Create('n2.exe', fmCreate or fmOpenWrite);
try
SetLength(s,readit.Size);
readit.Read(PChar(s)^, Length(s));
s:=reversestring(s); //<<<<<<-This line is incorrect
writeit.Write(PChar(s)^, Length(s));
finally
readit.Free;
writeit.Free;
end;
end;