Reputation: 7958
I would like to cast an existing string to an enum (not read it in as an enum). How can I do this?
Upvotes: 5
Views: 3021
Reputation: 7958
example:
-- type declaration
type Hands is (Left, Right);
-- code body
Hand : Hands;
Hand := Hands'Value("Left"); -- yields `Left`
Upvotes: 8