W
whaoye
Unregistered / Unconfirmed
GUEST, unregistred user!
这是一小段程序,
var
mystream:tmemorystream;
s:string;
begin
mystream:=tmemorystream.Create;
try
mystream.Write('123456',6);
mystream.Read(s[1],6);
showmessage(s);
finally
mystream.Free;
end;
为什么在showmessage(s)的时候,我没有得到我期望的'123456'?
什么地方不对呢?
并且如果我在中间修改一下:
mystream.Write('123456',6);
mystream.position:=0;
mystream.Read(s[1],6);
showmessage(s);
就出错,为什么?
var
mystream:tmemorystream;
s:string;
begin
mystream:=tmemorystream.Create;
try
mystream.Write('123456',6);
mystream.Read(s[1],6);
showmessage(s);
finally
mystream.Free;
end;
为什么在showmessage(s)的时候,我没有得到我期望的'123456'?
什么地方不对呢?
并且如果我在中间修改一下:
mystream.Write('123456',6);
mystream.position:=0;
mystream.Read(s[1],6);
showmessage(s);
就出错,为什么?