Einzelnen Beitrag anzeigen

Benutzerbild von City Light
City Light

Registriert seit: 17. Sep 2002
314 Beiträge
 
#6
  Alt 24. Mai 2003, 18:31
Danke euch ,das ihr mir helfen wollt ,aber mein Problem ist immer noch der selbe. *seufz*

Delphi-Quellcode:
implementation

{$R *.dfm}

procedure GetFileList(const Path: string; const Extensions: string; FileList:
  TStrings);
var
  SR: TSearchRec;
begin
  if FindFirst(Path + '*.*', faAnyFile, SR) = 0 then
  try
    repeat
      if (SR.Attr and faDirectory) > 0 then
      begin
        if SR.Name[1] <> '.then
          GetFileList(Path + SR.Name + '\', Extensions, FileList);
      end
      else if Pos(UpperCase(ExtractFileExt(SR.Name)), Extensions) > 0 then
        FileList.Append(Path + SR.Name);
    until
      FindNext(SR) <> 0;
  finally
    FindClose(SR);
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  i: Integer;
  sl: TStringList;
begin
  sl := TStringList.Create;
  try
    GetFileList('c:\', '.DPR .PAS .DFM .DCU', sl);
    for i := 0 to sl.count - 1 do
    begin
      CopyFile(PChar(sl.Strings[i]), (PChar('C:\Projekte\'+ (ExtractFileName(sl.Strings[i])))), True); // hier kommt der Fehler (59)
    end;
  finally
    sl.Free;
  end;
end;

end.
[Fehler] Unit1.pas(59): Anweisung erforderlich, aber Ausdruck vom Typ 'LongBool' gefunden
[Fataler Fehler] Project1.dpr(5): Verwendete Unit 'Unit1.pas' kann nicht compiliert werden
Bis bald man liest sich
Tino
  Mit Zitat antworten Zitat