Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ada String to Enumeration Conversion

Tags:

string

enums

ada

I would like to cast an existing string to an enum (not read it in as an enum). How can I do this?

like image 510
weberc2 Avatar asked Feb 18 '23 21:02

weberc2


1 Answers

example:

-- type declaration
type Hands is (Left, Right);

-- code body
Hand : Hands;
Hand := Hands'Value("Left"); -- yields `Left`
like image 160
weberc2 Avatar answered Apr 28 '23 13:04

weberc2