uses
..., Generics.Collections;
type
TProcList = class(TDictionary<string, TProc>);
TForm1 = class(TForm)
...
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
public
ProcList : TProcList;
procedure TestStringCallMethod;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ProcList := TProcList.Create();
//호출할 함수명과 함수 저장
ProcList.Add('TestStringCallMethod', TestStringCallMethod);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
ProcList.Free;
end;
procedure TForm1.TestStringCallMethod;
begin
ShowMessage('문자열 함수 호출 성공!');
end;
문자열로 함수 호출하기
ProcList['TestStringCallMethod'].Invoke;
반응형