function TFMPdel.FindFilesName(StrFilesName:string):boolean;
var Rec:TSearchRec;
    Done:Integer;
    StrHead:string;
begin
  StrHead:='i';
  Done:=FindFirst('E:\_libsrc\del\*.dat',faAnyFile,Rec);
  While Done=0 do
  begin
    StrFilesName:=Rec.Name;
    Done:=FindNext(Rec);
  end;
  FindClose(Rec);
  StrFilesName:=Copy(StrFilesName,1,1);
  if (StrFilesName=StrHead) then
  Result:=true;
end;function CheckString(StrIn:string;index:integer;var temp:boolean):string;
var StrinCopy:string;
begin
  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
    begin
      if FindFilesName(StrFilesName) then
      strIn:='I';
       temp:=true;
    end;
  StrIn:=trim(StrIn);
  if (index=6) or (index=7) or (index=13) then
      strIn:=strIn+' ';
      StrIn:='"'+StrIn+'"';
    Result:=StrIn;
end;编译报错:[Error] UPdel.pas(100): Undeclared identifier: 'FindFilesName'
为什么啊~?

解决方案 »

  1.   

    你的FindFilesName是在类TFMPdel,而CheckString并不是该类中的成员,但他直接引用FindFilesName,当然找不到了,前面加上类名FMPdel,或者把它也放在那个类TFMPdel中就好了
      

  2.   

    因为FindFilesName(StrFilesName:string):boolean;
    function CheckString(StrIn:string;index:integer;var temp:boolean):string;
    不在同一个类中的原因
    你可以把checkstring函数加到TFMPdel类中
      

  3.   

    function TFMPdel.FindFilesName(StrFilesName:string):boolean;
    改为:
    function FindFilesName(StrFilesName:string):boolean;