Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Louis DeLongchamp — — source: Informix-list mailing list archive (1991-1998)
sandys@easter.euro.csg.mot.com ("Sandy Spiers") wrote:
>On May 21, 3:17pm, Bob Payne wrote:
>> How do you get a remainder (aka modulus) in INFORMIX-4GL?
>Hey bob,
>you were close its actually the 'MOD' command you're looking for and you're
>right its not in the 4.0 manuals. I think its released "officially" with the
>6.0 but heres an example anyway..
> IF this_number MOD that_number = 0 THEN
> ... blah ... blah ... blah
> END IF
>Hope it helps
>sandys :)
And here's a recent post using mod to find the number of days
for a certain month.
function fn_leap(fndate)
define
fndate date,
j, k smallint
let j = month(fndate)
if j = 4 or j = 6 or j = 9 or j = 11 then return 30 end if
if j <> 2 then return 31 end if
let k = year(fndate)
if k mod 100 = 0 then
if k mod 400 = 0 then return 29
else return 28 end if
else
if k mod 4 = 0 then return 29 end if
end if
return 28
end function
Louis DeLongchamp
loudelon@vianet.on.ca
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.