Page 1 of 1

BOOL() function

Posted: Sun Mar 19, 2023 7:16 pm
by utopiomania
I,m trying to run older 4.30 code, but now PB doesnt understand BOOL(). This doesn't work: BOOL(Yr % 400 = 0)
Expression is supposed to be false if Year modulo 400 is false, If I just delete BOOL the logic that relied on BOOL
seems to work, at least there are no errors reported.. ?

Re: BOOL() function

Posted: Sun Mar 19, 2023 7:42 pm
by STARGĂ…TE
There was no Bool() in PureBasic 4.30, it was added in PureBasic 5.10
How your old code can have Bool()?
Bool works fine here in PB 6.0

Code: Select all

Debug Bool(Yr % 400 = 0)
1

Re: BOOL() function

Posted: Sun Mar 19, 2023 8:00 pm
by Caronte3D
Also, you don't need the Bool function for that comparison, use simply:

Code: Select all

If (Yr % 400)
or

Code: Select all

If Not (Yr % 400)

Re: BOOL() function

Posted: Sun Mar 19, 2023 10:06 pm
by utopiomania
Thanks ! I didnt even know I wrote something in 5.10 ;-) Its strange, almost everytime I run older code on a newer compiler, or
newer code on an older compiler, it ends up in a f*ckin plane chrash with flames and all, and... back to the drawing board :)