.net is a extremly dangerous thing ;-)
Posted: Wed Aug 29, 2018 5:59 pm
Hi Karl-Heinz,
In this case, the compiler cannot make any conversion, as it does not know from what type to convert to a Double. So it assumes oNumeric really holds a double, which fails at runtime because it actually holds an INT.
Btw, a note to everybody, this is not a compatibility problem with VO at all, because in VO you could not put numeric values into an OBJECT var...
Chris
If aDouble is a an array of Double (and not array of Object), then it is absolutely safe, everything is known at compile time. But this wouldn't be safe, as the type of the oNumeric var is not known at compile time:Karl-Heinz wrote: So this isn´t save enough ?
Code: Select all
aDouble [ 1 ] := (double) -1223.56 aDouble [ 2 ] := (double) 7869 aDouble [ 3 ] := (double) aDouble [ 1 ] + (double) aDouble [ 2 ]
Code: Select all
LOCAL oNumeric AS OBJECT
o := 1234
aDouble [ 1 ] := (double) oNumeric
Btw, a note to everybody, this is not a compatibility problem with VO at all, because in VO you could not put numeric values into an OBJECT var...
Chris