while testing some of our classes i had some odd results and after some debugging found some really serious issue with the expression evaluator

for example i have a function that is defined as follows

Function DoVpeGet VpeCoord_Type iWhat Returns VpeCoord_Type
if Not (phDocument(Self)) Begin
Error 255 VPEERROR_DOCUMENT_NOT_OPEN
Procedure_Return
End


Function_Return (VpeGet(phDocument(Self), iWhat))
End_Function


VpeCoord_Type is defined as Real


now the following code

Send DoVpeSet VTOP (DoVpeGet(Self,VBOTTOM))

should get the coordinate from the top and set the bottom. The top coordinate at that time is 5.4234 or something like that but DF decides to convert to an integer and set it to 5

if i change the line to 2 separate lines

Get DoVpeGet VBOTTOM to nvBottom
Send DoVpeSet VTOP nvBottom

the value is returned and set properly

i also see that this doesnt happen all the time.

i tried to xast the expression to a real

Send DoVpeSet VTOP (Real(DoVpeGet(Self,VBOTTOM)))

no help

just to make sure i tried to make all the parametrs real and not use the VpeCoord_type keyword but this didnt help either


this seems like quite a serious issue. Looks like the expression eval is for some reason deciding to change a return value from a function to an integer even though there is absolutely no reason to do this

Very scary not knwoing if any of our calculations will actually end up correct or cast to an integer.

i know the dataflex expression evaluator like casting results to integers if the parameters are integer or only some of them but in this case there is no integer involved at all