N
Nick Weekes
Hi all,
I am trying to cast a Double (its actually the NextDouble method of the
Random class, but could be any type of number) to a Type via its name.
Im trying the following syntax:
ThisNumber = (Type.GetType("MyType.Decimal"))(ThisRandom.NextDouble());
Im getting an error stating that 'Method name expected', so either im
not casting correctly or using incorrect syntax?
Thanks,
Nick
I am trying to cast a Double (its actually the NextDouble method of the
Random class, but could be any type of number) to a Type via its name.
Im trying the following syntax:
ThisNumber = (Type.GetType("MyType.Decimal"))(ThisRandom.NextDouble());
Im getting an error stating that 'Method name expected', so either im
not casting correctly or using incorrect syntax?
Thanks,
Nick