How can you use the type name returned from ttypeid name() method to cast an object back to it's original type?
Obviously this is much simplified but I have my original type name in a string variable called 'typename'.
Unfortunately, I can't use that to cast my original object. If you uncomment the print statement you get message
'Expression of string cannot be invoked'
Am I missing something?
SuperStrict Type ttest Field x:Int End Type Local test1:ttest=New ttest test1.x=5 Local test2:Object=Object(test1) Local id:TTypeId=TTypeId.ForObject(test2) Local typename:String=id.name() Print typename 'Print typename(test2).x
Obviously this is much simplified but I have my original type name in a string variable called 'typename'.
Unfortunately, I can't use that to cast my original object. If you uncomment the print statement you get message
'Expression of string cannot be invoked'
Am I missing something?