Hi,
I got a combo box where you can select stuff and I coded it with this:
procedure TFrmDatabase.ComboBox1Change(Sender: TObject);
begin
case combobox1.Text of
'GiftAidID': searchbox.Width:= 80;
'Title': searchbox.Width:= 50;
'Initial': searchbox.Width:= 20;
'Surname': searchbox.Width:= 100;
'Address': searchbox.Width:= 500;
'PostCode': searchbox.Width:= 100;
'E-mail': searchbox.Width:= 400;
'DateR': searchbox.Width:= 200;
'AmountRaised': searchbox.Width:= 70;
end;
But the stupid program keeps highlighting the bolded part and says: 'Ordinal Type required'!
Any help appreciated? I have always done case this way, well i pascal anyways.
Thanks
Case statements require NUMBERS, not strings. Specifically, an ordinal type is an Integer, Word, etc.
But in pascal, I was able to use strings...so is that just pascal?
Omg, so I have to give each variable a number and then do it? argh.
EDIT:
Lucky me, I can use the Combobox's 'itemindex' . I would have had to list all everything otherwise >_>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks