Avec le code ci-dessous j'ai une erreur "Déclaration forward ou external non satisfaite: 'TFrm_Perso.ComboAddFile'".
Je n'arrive pas à trouver l'erreur, si il y a quelqu'un pour m'aider ce serait sympa, merci.
procedure TFrm_Perso.FormCreate(Sender: TObject);
begin
ComboAddFile('test.txt',ComboBox_Test);
end;
procedure ComboAddFile(Fichier:string; Cible:TComboBox);
var
F:TextFile;
L:string;
begin
AssignFile(F,ExtractFilePath(Application.ExeName)+Fichier);
Reset(F);
while not (EOF(F)) do
begin
Readln(F,L);
Cible.Items.Add(L);
end;
Closefile(F);
end;
type
TForm1 = class(TForm)
ComboBox_Test: TComboBox;
procedure FormCreate(Sender: TObject);
private
{ Déclarations privées }
public
procedure ComboAddFile(Fichier:string; Cible:TComboBox);
{ Déclarations publiques }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ComboAddFile(Fichier:string; Cible:TComboBox);
var F:TextFile;
L:string;
begin
AssignFile(F,ExtractFilePath(Application.ExeName)+Fichier);
Reset(F);
while not (EOF(F)) do
begin
Readln(F,L);
Cible.Items.Add(L);
end;
Closefile(F);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ComboAddFile('test.txt',ComboBox_Test);
end;