Subtraction with DWORD issue
Posted: Thu Apr 09, 2020 2:31 pm
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
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