PB5.00b7 no longer allows testing Not with string?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: PB5.00b7 no longer allows testing Not with string?

Post by Danilo »

PMV wrote:Its always the same ... just because something that was never
allowed to be was just used because it seemed to work fine.
Now it is disallowed and some people are going crazy.
"If Not a" is also not allowed, according to the international PureBasic programming language standard.

Code: Select all

s.s = "string"

If s
    Debug s
EndIf

;If Not s              ; already forbidden
;    Debug "s empty"
;EndIf


a.i = 10

If a
EndIf

If Not a
EndIf
All this can be removed any time, because it is not explicitly allowed and written down in the language standard/manual/reference.
Always write "If a <> 0" and "If Not a <> 0" etc.

For me, "If a" and "If s" make both sense. The opposite of both is "If Not a" and "If Not s", which makes sense, too.
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: PB5.00b7 no longer allows testing Not with string?

Post by skywalk »

Hard to argue that "logic" :)
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: PB5.00b7 no longer allows testing Not with string?

Post by chris319 »

"If Not a <> 0"
Why wouldn't you simply write "If a = 0"?
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: PB5.00b7 no longer allows testing Not with string?

Post by Danilo »

chris319 wrote:
"If Not a <> 0"
Why wouldn't you simply write "If a = 0"?
Because we talk about 'Not' here. :D
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: PB5.00b7 no longer allows testing Not with string?

Post by chris319 »

Danilo wrote:
chris319 wrote:
"If Not a <> 0"
Why wouldn't you simply write "If a = 0"?
Because we talk about 'Not' here. :D
Oh, I see. I suppose you would rather write "If Not a = 0" instead of "If a <> 0".
Post Reply