Given the following declarations below, is there a way to retrieve the enum value (e.g. jt_one) from a string value (e.g. ‘one’)?
type
TJOBTYPEENUM =(jt_one, jt_two, jt_three);
CONST JOBTYPEStrings : ARRAY [jt_one..jt_three] OF STRING =
('one','two','three');
Or do i need to create my own function using a nested set of if statements?
NOTE: I am not looking for the string “jt_one”
In real code you’d want to use your own exception class. And if you want to allow case insensitive matching, compare strings using
SameText.