BOOL() function

Just starting out? Need help? Post your questions and find answers here.
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

BOOL() function

Post 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.. ?
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: BOOL() function

Post 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
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
Caronte3D
Addict
Addict
Posts: 1027
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: BOOL() function

Post 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)
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Re: BOOL() function

Post 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 :)
Post Reply