I'll normally build a key/value pair array in a data table somewhere (sql custom table, if available). you could also have a flat file that delimits the values in some way. so:
A|Apple
B|Banana
C|Carrot
so that if a text value = A, you can check the array for the corresponding value for the key A, which will then resolve to the value of Apple (then assign that value to whatever variable you need).