home *** CD-ROM | disk | FTP | other *** search
- { FormulaBuilder }
- { YGB Software, Inc. }
- { Copyright 1995 Clayton Collie }
- { All rights reserved }
-
- {* Dialog which lists all functions registered with the FormulaBuilder *}
- {* Engine *}
-
- unit Funcdlg;
- interface
- uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,
- StdCtrls, ExtCtrls;
-
- type
- TFunctionDlg = class(TForm)
- OKBtn: TBitBtn;
- CancelBtn: TBitBtn;
- HelpBtn: TBitBtn;
- Bevel1: TBevel;
- FunctionList: TListBox;
- GroupBox1: TGroupBox;
- Memo1: TMemo;
- FunctionCountLabel: TLabel;
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- FunctionDlg: TFunctionDlg;
-
- Procedure DisplayFunctionList;
-
- implementation
- uses fbCalc,sysutils,fbmisc;
-
- {$R *.DFM}
- {$F+}
-
- var
- Tmpdlg : TFunctionDlg;
-
-
- Procedure DisplayFunctionList;
- var dlg : TFunctionDlg;
- begin
- InitFbuilder;
- Dlg := TFunctionDlg.Create(NIL);
- try
- Dlg.ShowModal;
- Finally
- Dlg.Free;
- FreeFbuilder;
- end;
- end;
-
- Function GetFuncNames(vname : pchar;
- vtype : byte;
- parms : pchar;
- minPrms : byte;
- lParam : longint):integer; export;
- var proto,tmp : string[60];
- i : integer;
-
- begin
- tmp := strpas(parms);
- Proto := ShortPrototype(strpas(vname),tmp,length(tmp),minprms);
- tmp := DataTypeName(vType);
- Proto := Proto + ':'+tmp;
- TmpDlg.FunctionList.Items.Add( proto );
- end;
-
-
-
-
- procedure TFunctionDlg.FormCreate(Sender: TObject);
- begin
- tmpDlg := Self;
- InitFbuilder; { Just to be safe }
- if not FBLoaded then exit;
- FBEnumFunctions( GetFuncNames , LONGINT(0) );
- With FunctionCountLabel do
- Caption := Caption + IntToStr(FBGetFunctionCount);
- FreeFBuilder;
- end;
-
- end.
-