I am trying to write a generic method that can manage my test data from XLS. Below is code where I am not able to TypeCast data using a user-defined datatype.

</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[-] type PROCESS is enum
[ ] TEST
[ ] DEV
[ ] IT
[ ] MKT
[-] type REC is record
[ ] PROCESS eProc
[-] main ()
[-] REC rcRec={...} // Record to hold my data from XLS file
[ ] DATATYPE dtProcess = TypeOf(rcRec.eProc) // Get the data type
[ ] rcRec.eProc = [dtProcess]&quot;TEST&quot; // TypeCast using the data type
[ ] Print (rcRec)</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">With this code I get an error "Type dtProcess is not defined"

I know that if I use PROCESS in place of dtProcess it works. But, I want to generalize so that the method will know the data type through TypeOf instead of me hard-coding.

Any suggestions are appreciated.