I've seen this design in other apps such as MyDBF Studio. This is the way I designed a TComboBox for selecting/changing the index for a particular table. This app is designed with dBase v7, see below the Case statement allowing the user to select a sort/index stored in the Items/TStrings. Compiles but when I run it, it's not selecting what I selected or rather the Case statement I wrote is not right. When I test, it's not executing the Case selections, it's dropping into the ELSE. Should I be using DBListBox or combo instead?
procedure TFrmCntksMain.CmboBxIndexBySelect(Sender: TObject);
begin
Case CmboBxIndexBy.SelText of
'Contact ID#':DbfContacts.IndexName:= 'CONTACTID';
'Name(L,F,M)':DbfContacts.IndexName:= 'CNTKNAME';
'Category':DbfContacts.IndexName:= 'CATEGORY';
'State/Province':DbfContacts.IndexName:= 'STATPROV';
'Country':DbfContacts.IndexName:= 'CNTRYCODE';
else
WriteLn('Index value not selected...');
end;
DbfContacts.Refresh;
end;