ich bin gerade dabei mir Free Pascal -mit Lazarus- anzueignen und stehe schon vor meinem ersten Problem, das ich mit Logik und googeln nicht mehr lösen kann
ich bekomme folgende fehlermeldungen beim compilieren:
Hint: Start of reading config file C:\programs\lazarus\fpc\2.4.4\bin\i386-win32\fpc.cfg
Hint: End of reading config file C:\programs\lazarus\fpc\2.4.4\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.4.4 [2011/10/24] for i386
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Win32 for i386
Compiling test_1.lpr
Compiling test.pas
test.pas(39,68) Error: Wrong number of parameters specified for call to "GetFilesInDirectory"
test.pas(24,17) Hint: Found declaration: TForm1.GetFilesInDirectory;
test.pas(88, stopping
der code ist folgender:
Code: Alles auswählen
unit test;
//{$mode objfpc}{$H+}
{$mode delphi}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
ListBox: TListBox;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
procedure GetFilesInDirectory;
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
ListBox.Clear;
GetFilesInDirectory('T:\MTX\Log\', '*.log', ListBox.Items, False, False); //diese Zeile wird "angemeckert"
end;
procedure GetFilesInDirectory(Directory: string; const Mask: string;
List: TStrings;
WithSubDirs, ClearList: Boolean);
procedure ScanDir(const Directory: string);
var
SR: TSearchRec;
begin
if FindFirstUTF8(Directory + Mask, faAnyFile and not faDirectory, SR) { *Converted from FindFirst* } = 0 then try
repeat
List.Add(Directory + SR.Name)
until FindNextUTF8(SR) { *Converted from FindNext* } <> 0;
finally
FindCloseUTF8(SR); { *Converted from FindClose* }
end;
if WithSubDirs then begin
if FindFirstUTF8(Directory + '*.*', faAnyFile, SR) { *Converted from FindFirst* } = 0 then try
repeat
if ((SR.attr and faDirectory) = faDirectory) and
(SR.Name <> '.') and (SR.Name <> '..') then
ScanDir(Directory + SR.Name + '\');
until FindNextUTF8(SR) { *Converted from FindNext* } <> 0;
finally
FindCloseUTF8(SR); { *Converted from FindClose* }
end;
end;
end;
begin
List.BeginUpdate;
try
if ClearList then
List.Clear;
if Directory = '' then Exit;
if Directory[Length(Directory)] <> '\' then
Directory := Directory + '\';
ScanDir(Directory);
finally
List.EndUpdate;
end;
end;
end.
Kann mir jemand den Fehler aufzeigen und ihn erklären??
Danke
mtbf40