xsharp.eu • Subtraction with DWORD issue
Page 1 of 1

Subtraction with DWORD issue

Posted: Thu Apr 09, 2020 2:31 pm
by boonnam
I know DWORD can't be negative, but using DWORD in subtraction shouldn't be an issue, right? For example:
local sys_date as date
local dNewDate as date
local dwNum as dword

sys_date := Today() //4/9/2020
dwNum := 3
dNewDate := sys_date-dwNum


I'm expecting dNewDate to be 4/6/2020, in our XSharp conversion program, it crashed. The error is "Value to add was out of range.". If I cast it to INT, it works.

dNewDate := sys_date -(INT)dwNum
//dNewDate is 4/6/2020.


In this case we are using dword as subtraction, not making it negative. Any thought?

Thanks,
Boonnam

Subtraction with DWORD issue

Posted: Thu Apr 09, 2020 2:34 pm
by Chris
Hi Boonam,

This is a known issue, will be fixed in the next build which should be released soon. I will send you a quick fix dll that you can use in the meantime