function CheckString(StrIn:string;index:integer;var temp:boolean):string;
var StrinCopy:string;
StrFilesName:string;
strFilesNameF:string;
Rec:TSearchRec;
Done:Integer;
begin
temp:=true;
Done:=FindFirst('E:\_libsrc\del\*.dat',faAnyFile,Rec); if Done<>0 then
StrFilesName:=Rec.Name;
//Done:=FindNext(Rec);
StrFilesNameF:=Copy(StrFilesName,1,1); FindClose(Rec);
if (StrFilesNameF='i') and (index=14) then
strIn:='I';
temp:=true;
if (StrFilesNameF='e') and (index=14) then
strIn:='E';
temp:=true;
if index=8 then
if strIn='000000' then
temp:=false;
if index=11 then
StrinCopy:=Copy(strIn,1,8);
if StrinCopy='00000000' then
temp:=false;
//if index=14 then
//temp:=true;
StrIn:=trim(StrIn);
if (index=6) or (index=7) or (index=13) then
strIn:=strIn+' ';
StrIn:='"'+StrIn+'"';
Result:=StrIn;
end;如果文件名是i打头的,第14个字段为‘I’,e打头的为‘E’,这段代码是否可以做到?
var StrinCopy:string;
StrFilesName:string;
strFilesNameF:string;
Rec:TSearchRec;
Done:Integer;
begin
temp:=true;
Done:=FindFirst('E:\_libsrc\del\*.dat',faAnyFile,Rec); if Done<>0 then
StrFilesName:=Rec.Name;
//Done:=FindNext(Rec);
StrFilesNameF:=Copy(StrFilesName,1,1); FindClose(Rec);
if (StrFilesNameF='i') and (index=14) then
strIn:='I';
temp:=true;
if (StrFilesNameF='e') and (index=14) then
strIn:='E';
temp:=true;
if index=8 then
if strIn='000000' then
temp:=false;
if index=11 then
StrinCopy:=Copy(strIn,1,8);
if StrinCopy='00000000' then
temp:=false;
//if index=14 then
//temp:=true;
StrIn:=trim(StrIn);
if (index=6) or (index=7) or (index=13) then
strIn:=strIn+' ';
StrIn:='"'+StrIn+'"';
Result:=StrIn;
end;如果文件名是i打头的,第14个字段为‘I’,e打头的为‘E’,这段代码是否可以做到?
解决方案 »
- 五子棋小游戏
- 设置代理发送邮件如何实现 delphi
- 怪事,是哪里问题?高手是小菜一碟?
- 寻求李维<delphi5.x 分布式多层应用>系统篇所带光盘中的例程
- 可不可以共用一个TDatasource控件?
- 初学者高分请教。
- 实在是做不下去了,准备辞职
- 如何通过变量来传递label的name,并让函数来对该label进行操作?
- 怎么用一个按钮实现连接,断开数据库?按钮分别显示连接和断开.用最简洁的代码
- 我把delphi5安装盘的文件拷贝到硬盘,为何不能安装了???
- 问一下,论坛搜索的时候怎么搜索多个关键字啊?还有如何判断edit1,edit2,edit3是否都为空
- 天啊,我的程式怎麽了啊,在別的機孖上啟動時說rtl60.bpl類沒有登錄
一个dat文件就是一条记录,每个文件名第一个字符要么是‘i’要么是‘e’,我要做的就是获得文件名的第一个字符,判断是i还是e。一条记录原来有13个字段,现在要加一个字段,来标识该文件是进口('I'表示)还是出口(‘E’表示),就是这样。