Delphi程序:谁能帮我具体的注解一下

来源:百度知道 编辑:UC知道 时间:2024/06/15 10:06:10
我要详细的注解,包括每一步是做什么的,特别是用流的方式传文件的那块
procedure TFormComPort.SendFile(const filename: string);
var
S:TStringList;
F:file of byte;
i,sendlen,len,len2,l_str:integer;
Blocknum,Remainlen:integer;
BlockBuf:array[0..BlockLen-1] of byte;
lenbuf:array[0..9]of byte;
len_str,syn:string;
begin
{S:=TStringList.Create;
try
S.LoadFromFile(filename);
SendString(S.Text);
finally
S.Free;
end; }
comport.WriteStr('File');
ComLed.Kind:=lkGreenLight;
AssignFile(F,filename);
Reset(F);
len:=FileSize(F);
for i:=0 to 9 do
lenbuf[i]:=$FF;
len_str:=IntToStr(len);
l_str:=length(len_str);
if (l_str mod 2=0) then
len2:=round(l_str/2)-1
else
len2:=round(l_str/2+0.5)-1;
for i:=0 to len2 do
lenbuf[i]:=StrToInt('$'+copy(len_str,2*i+1,2));
comport.Write(lenbuf,10);

comport是什么对象?它的几个方法write、writestr分别是什么意思?
ComLed又是什么东东?
整个程序感觉有点象是跟串口相关
只有知道了上述几个问题的答案才好回答