- Heiko Bergner
- PowerBuilder
- Monday, 3 September 2018 11:28 AM UTC
Hello,
I created a support ticket for this, but maybe someone had a similar problem and found a solution.
*Phenomenon:
If I use the dw_1.describe("evaluate('"+ls_eval+"',1)") function to calculate some decimal values
this works fine on a real PC. If I run the same on a virtual machine the result is wrong.
Example: 3.5 * 3.5 = 12.25 on PC but on VM the result is 9 (see attachment)
The wrong calculation was reproduced on a Micrsoft Hyper-V machine running Windows 10 and
also on a VMWare running on Windows Server 2008
The error can be reproduced using the 'evaluate()' function and with modify(...expression)
*Reproduce Steps:
// script estimates you have a datawindow dw_1
// test the functionality of evaluate /expression
string ls_eval
string ls_result_eval
decimal lc_result_express
string ls_ret
long ll_row
// the string that should be evaluated
ls_eval = "3.5 * 3.5"
// test with evaluate
ls_result_eval = dw_1.describe("evaluate('"+ls_eval+"',1)")
// test with expression
ls_ret = dw_1.modify('create compute(band=foreground alignment="0" expression="'+ls_eval+&
'" border="0" color="0" x="394" y="400" height="1" width="1" format="[general]" '+&
'name=evalresult font.face="Arial" font.height="-6" font.weight="400" '+&
'font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )')
// normaly here are some checks for coltype,...
lc_result_express= dw_1.getitemnumber(1,"evalresult")
Messagebox("Result for evaltest","Result for: "+ls_eval+"~r~n~r~nevaluate: "+string(ls_result_eval)+"~r~nexpression: "+string(lc_result_express))
dw_1.modify("destroy evalresult")
Best Regards,
Heiko
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.