begin
OpenFile.InitialDir :=app_path;
OpenFile.Filter :='PMID list file(*.pid)|*.pid';
OpenFile.Execute ;
PMIDfilepath:=OpenFile.FileName;
if FileExists(PMIDfilepath) then begin
printcmd('PMID文件"'+PMIDfilepath+'"已经就绪,点"运行"下载.');
PMIDfile:=TStringlist.create ;
PMIDfile.LoadFromFile(PMIDfilepath);
//从pid文件格式化命令脚本
cmdtemp:='DownPubMedXML('+PMIDfile.Text+ ')';
cmdtemp:=stringreplace(cmdtemp,#13#10,',',[rfreplaceall]);中的[rfreplaceall]??什么意思??
cmdtemp:=stringreplace(cmdtemp,',)',')',[rfreplaceall]);
//把下载XML的命令输出到inputcmd窗口
inputcmd(cmdtemp);??inputcmd什么意思,是什么函数??
end;
最好每一行都能简单的介绍一下意思,谢谢!
OpenFile.InitialDir :=app_path;
OpenFile.Filter :='PMID list file(*.pid)|*.pid';
OpenFile.Execute ;
PMIDfilepath:=OpenFile.FileName;
if FileExists(PMIDfilepath) then begin
printcmd('PMID文件"'+PMIDfilepath+'"已经就绪,点"运行"下载.');
PMIDfile:=TStringlist.create ;
PMIDfile.LoadFromFile(PMIDfilepath);
//从pid文件格式化命令脚本
cmdtemp:='DownPubMedXML('+PMIDfile.Text+ ')';
cmdtemp:=stringreplace(cmdtemp,#13#10,',',[rfreplaceall]);中的[rfreplaceall]??什么意思??
cmdtemp:=stringreplace(cmdtemp,',)',')',[rfreplaceall]);
//把下载XML的命令输出到inputcmd窗口
inputcmd(cmdtemp);??inputcmd什么意思,是什么函数??
end;
最好每一行都能简单的介绍一下意思,谢谢!
OpenFile.Filter :='PMID list file(*.pid)|*.pid'; //文件过滤,只能打开.pid扩展名的文件
OpenFile.Execute ; //OpenDialog控件打开,当Execute=true时选择了文件
PMIDfilepath:=OpenFile.FileName; //取得选择的文件名
if FileExists(PMIDfilepath) then begin //如果文件存在
printcmd('PMID文件"'+PMIDfilepath+'"已经就绪,点"运行"下载.'); //printcmd是自定义的函数
PMIDfile:=TStringlist.create ; //创建TStringList
PMIDfile.LoadFromFile(PMIDfilepath);
//从pid文件格式化命令脚本
cmdtemp:='DownPubMedXML('+PMIDfile.Text+ ')';
cmdtemp:=stringreplace(cmdtemp,#13#10,',',[rfreplaceall]); //把字符串cmdtemp里面的换行符#13#10全部换成",".
cmdtemp:=stringreplace(cmdtemp,',)',')',[rfreplaceall]);//把字符串cmdtemp里面的",)"全部换成")" //把下载XML的命令输出到inputcmd窗口
inputcmd(cmdtemp);??inputcmd什么意思,是什么函数?? //inputcmd应该是自定义的函数
begin
cmd.lines.Delete(cmd.Lines.Count-1);
cmd.lines.append(command);
cmd.Lines.Append(' ');
postmessage(cmd.handle, WM_VSCROLL, 0, SB_LINEDOWN);
end;
begin
cmdinput.Clear ;
cmdinput.lines.text:=command;
postmessage(cmdinput.handle, WM_VSCROLL, 0, SB_LINEDOWN);
end;
里面是一个一个字符串元素的.
好像:
111
222
333
aaa
bbb
ccc
它有两个方法可以把内容保存到文件或者从文件加载内容 SaveToFile跟LoadFromFile
Text即取出里面的所有元素,用换行符#13#10隔开
即 Text:='111'+#13#10+'222'+#13#10+'333'....PMIDfile.LoadFromFile(PMIDfilepath); //把PMIDFilepath文件的内容加到PMIDFilecmdtemp:='DownPubMedXML('+PMIDfile.Text+ ')'; cmdtemp是一个字符串类型,只是把PMIDfile里的内容跟''DownPubMedXML('等结合起来
begin
cmd.lines.Delete(cmd.Lines.Count-1); //删除TMemo的最后一行
cmd.lines.append(command); //添加显示一行,内容为command
cmd.Lines.Append(' '); //添加显示一空行
postmessage(cmd.handle, WM_VSCROLL, 0, SB_LINEDOWN); //TMemo向下滚动一行
end;