Quote:Original post by DigiDude
Why not just do this:today = saturday;
For my app, I couldn't do this because I don't know the day beforehand, this data has to be read from a file.
In my original plan, I was suppose to read the data in as a string from the file, e.g. "saturday", but I didn't know how to convert string to enum. So I thought of using integers to represent days, to make things easier.
today ?= "saturday"
Quote:Original post by Telastyn
Personally, I've moved away from enums due to other reasons and only really use them now when the result absolutely never, ever needs displayed or inputed by users or between components. Which is rare to say the least.<!–QUOTE–></td></tr></table></BLOCKQUOTE><!–/QUOTE–><!–ENDQUOTE–><br>How do you convert string to enum, and enum to string?