e.g.: relativedate(date('1899-12-30', 36000)) -> returns 17.02.1819
-> should return approx. 30.12.1997
in a computed field in a dw it works, in a script it doesn't
On Mon, 7 May 2001 14:23:35 +0200,
in powersoft.public.powerbuilder.powerscript
Bruce Armstrong [TeamSybase]
http:\\www.needhim.org
---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp
FWIW PowerBuilder doesn't complain about an overflow of datatypes. For
instance.
int li_Test
li_test = 32767 + 1
li_Test will be equal to -32768. The integer loops to it's bottom limit then
starts counting up. So 36000 would give you something like -29535 which is
why you get a date before your relativedate. To get around this you can put
you code in a loop and execute it as many times as necessary.
Good Luck
Michael Walker
Cascadia Software
Xavier Colmant wrote in message ...
>relativedate(date, int) takes an integer as 2nd argument. In the script
the
>integers are defined as:
>16-bit signed integers, from -32768 to +32767. 36000 being larger than the
>limit, you are in fact sending a negative number to relative date...
>
>In the datawindow integers are probably 32 bits long...
>
>Frankly, right now I cannnot think of a nice way of getting around the
>problem:
>Use a long. If value greater than the limit, split the long in 2 (or
more?)
>int, and do 2 calls to relativedate().
>
>Xavier
>
>"Martin" <m.kalt...@xpoint.at> wrote in message
>news:oVB7dOv...@forums.sybase.com...
In the datawindow integers are probably 32 bits long...
Frankly, right now I cannnot think of a nice way of getting around the
problem:
Use a long. If value greater than the limit, split the long in 2 (or more?)
int, and do 2 calls to relativedate().
Xavier
"Martin" <m.kalt...@xpoint.at> wrote in message
news:oVB7dOv...@forums.sybase.com...