home *** CD-ROM | disk | FTP | other *** search
- unit SelIndex;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ExtCtrls, DB;
-
- type
- TFrmSelectIndex = class(TForm)
- Panel1: TPanel;
- BtnOk: TButton;
- BtnClose: TButton;
- ComboBox1: TComboBox;
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- private
- { Private declarations }
- public
- { Public declarations }
- function OpenIndex(IndexDefs : TIndexDefs;sIndexFieldNames : String) : String;
- end;
-
- var
- FrmSelectIndex: TFrmSelectIndex;
-
- implementation
-
- {$R *.DFM}
-
- function TFrmSelectIndex.OpenIndex(IndexDefs : TIndexDefs; sIndexFieldNames : String) : String;
- var
- I : Integer;
- begin
- Result := sIndexFieldNames;
- IndexDefs.Update;
- ComboBox1.Items.Clear;
- ComboBox1.Text := sIndexFieldNames;
- for I := 0 to IndexDefs.Count - 1 do
- ComboBox1.Items.Add(IndexDefs.Items[I].Fields);
- if (Self.ShowModal = mrOk) then
- Result := ComboBox1.Items[ComboBox1.ItemIndex];
- end;
-
- procedure TFrmSelectIndex.FormClose(Sender: TObject;
- var Action: TCloseAction);
- begin
- Action := caFree;
- end;
-
- end.
-