GreatOne
можно так: [more] uses
TypInfo;
type
TNumericChoiceParent = (ncp_Mother, ncp_Father, ncp_Child);
procedure TForm1.btChooseClick(Sender: TObject);
var
S: string;
begin
S := InputEdit.Text;
case TNumericChoiceParent(GetEnumValue(TypeInfo(TNumericChoiceParent), 'ncp_' + S)) of
ncp_Mother: ShowMessage('Hello Mom )');
ncp_Father: ShowMessage('Hi, Dad -]');
ncp_Child: ShowMessage('Shut up and eat your soup !-(');
else
ShowMessage('Who do you think that you are?');
end;
end;[/more]
сам не проверял, но вроде говорят работает
можно так: [more] uses
TypInfo;
type
TNumericChoiceParent = (ncp_Mother, ncp_Father, ncp_Child);
procedure TForm1.btChooseClick(Sender: TObject);
var
S: string;
begin
S := InputEdit.Text;
case TNumericChoiceParent(GetEnumValue(TypeInfo(TNumericChoiceParent), 'ncp_' + S)) of
ncp_Mother: ShowMessage('Hello Mom )');
ncp_Father: ShowMessage('Hi, Dad -]');
ncp_Child: ShowMessage('Shut up and eat your soup !-(');
else
ShowMessage('Who do you think that you are?');
end;
end;[/more]
сам не проверял, но вроде говорят работает