I have an OnClick handler defined as follows:
procedure TfrmFOpenTool.cboFDomainClick(Sender: TObject);
var
ix : integer;
ic : integer;
begin
ic :=TfrmFOpenTool.cboFDomain.items.Count;
ix :=TfrmFOpenTool.cboFDomain.itemindex;
end;
I'm trying to grab the values of the ItemsCount and the ItemIndex. I have seen other handlers which declare local variables, and everything seems to work. However, my own attempt fails - miserably!
Only class methods, class properties and class variables can be referred with class references
Only class methods, class properties and class variables can be accessed in class methods
Seems pretty clear - but the highlighted portion of the offending line is around the control name.
The full class definition is:
TfrmFOpenTool = class(TForm)
cboFName: TComboBox;
cboFName1: TComboBox;
cboFName2: TComboBox;
cmdExit: TButton;
cmdBrowse: TButton;
cboFDomain: TComboBox;
lblDeviceValue: TLabel;
lblName: TLabel;
lblStructure: TLabel;
lblOrganization: TLabel;
lblNameValue: TLabel;
lblFOptions1: TLabel;
lblStructureValue: TLabel;
lblOrganizationValue: TLabel;
lblPriority: TLabel;
lblPriorityValue: TLabel;
lblIndexCount: TLabel;
lblIndexCountValue: TLabel;
lblDomain: TLabel;
lblRecSize: TLabel;
lblDomainValue: TLabel;
lblAccess: TLabel;
lblAccessValue: TLabel;
lblDevice: TLabel;
lblRecSizeValue: TLabel;
lblDOptions: TLabel;
lblAOptions: TLabel;
lblROptions: TLabel;
lblFOptions: TLabel;
txtFileName: TEdit;
txtFileEquation: TEdit;
lblFileName: TLabel;
lblFEQ: TLabel;
PageControl1: TPageControl;
pgFOptions: TTabSheet;
pgROptions: TTabSheet;
pgAOptions: TTabSheet;
pgDOptions: TTabSheet;
pgSpoolFile: TTabSheet;
pgIndexing: TTabSheet;
procedure cboFDomainChange(Sender: TObject);
procedure cboFDomainClick(Sender: TObject);
procedure cmdExitClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure pgFOptionsContextPopup(Sender: TObject; MousePos: TPoint;
var Handled: Boolean);
procedure pgROptionsContextPopup(Sender: TObject; MousePos: TPoint;
var Handled: Boolean);
Can anyone explain why I'm getting these errors.