麻烦翻译几句代码 ( 积分: 30 )

  • 主题发起人 sujing1982
  • 开始时间
S

sujing1982

Unregistered / Unconfirmed
GUEST, unregistred user!
学习别人写的代码 有点不明白 请指点一下
type
TSendBuffer = packed record
masmID : Word
ID : Word;
F1 : DWord;
F2 : DWord;
F3 : DWord;
F4 : DWord;
Len : DWord;
MD : Int64;
buffer : array [0..packsize-1] of byte;
end;
var
Snd : TSendBuffer ;
TP, UP, PSnd : Pbyte;
File_name :string;
begin
Snd.ID := 0
TP := PSnd;
Inc(TP,32);
File_name := ExtractFileName(Edit2.Text);
Snd.Len := Length(File_name) + 1;
Snd.F1 := FileSize;
UP := @File_name;
move(UP^,TP^,Snd.Len); {这个地方是什么意思?}
FClient.Socket.Send(PSnd^,Snd.Len + 32);
 
move(UP^,TP^,Snd.Len); {这个地方是什么意思?}
===>内存复制
在线帮助如是说:
Copies bytes from a source to a destination.
procedure Move(const Source; var Dest; Count: Integer);
Description
Move copies Count bytes from Source to Dest. No range checking is performed. Move compensates for overlaps between the source and destination blocks.

Whenever possible, use SizeOf to determine the count.
 
这是个文件传送例子中 告诉 服务器准备接受文件 的一段
具体到这里是做什么用? 把UP^ 中的内容复制到TP^?
 
就是这个意思
 
多人接受答案了。
 
顶部