Well, it only shows "b" in the Debug Output for me. So, it works correct here.coder14 wrote:On the flip side this should not work either:But it does.Code: Select all
a.s = "" b.s = "abc" If a : Debug "a" : EndIf If b : Debug "b" : EndIf
Logical NOT Operator (' ! ') in If-statements.
Re: Logical NOT Operator (' ! ') in If-statements.
Re: Logical NOT Operator (' ! ') in If-statements.
Dude wrote:Well, it only shows "b" in the Debug Output for me. So, it works correct here.

ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
Re: Logical NOT Operator (' ! ') in If-statements.
Code: Select all
a.s
b.s = ""
c.s = "abc"
If @a : Debug "a is set" : EndIf
If @b : Debug "b is set" : EndIf
If @c : Debug "c is set" : EndIf
If Not @a : Debug "a not set" : EndIf
If Not @b : Debug "b not set" : EndIf
If Not @c : Debug "c not set" : EndIf
Windows 11, Manjaro, Raspberry Pi OS


Re: Logical NOT Operator (' ! ') in If-statements.
It does m@kes sense LOL.idle wrote:m@kes sense doesn't it?
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
Re: Logical NOT Operator (' ! ') in If-statements.
it works but I'm not sure if it makes sense, I'm away in the Land of Grey and PinkThunder93 wrote:It does m@kes sense LOL.idle wrote:m@kes sense doesn't it?

Windows 11, Manjaro, Raspberry Pi OS


Re: Logical NOT Operator (' ! ') in If-statements.
With a.s your declaring a variable type.
With the usage of @ in the If-statement for the a variable, it's returning zero because there's no address until it's set.
With b variable and just specifying "", now variable has been set and address exists, no longer returning 0.
The Not operator works because it's going by addresses, hence numeric and not string.
... you know all this. Why wouldn't this make sense?
With the usage of @ in the If-statement for the a variable, it's returning zero because there's no address until it's set.
With b variable and just specifying "", now variable has been set and address exists, no longer returning 0.
The Not operator works because it's going by addresses, hence numeric and not string.
... you know all this. Why wouldn't this make sense?

ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
Re: Logical NOT Operator (' ! ') in If-statements.
you missed the part, I'm away in the Land of Grey and Pink. otherwise it m@kes sense!Thunder93 wrote:With a.s your declaring a variable type.
With the usage of @ in the If-statement for the a variable, it's returning zero because there's no address until it's set.
With b variable and just specifying "", now variable has been set and address exists, no longer returning 0.
The Not operator works because it's going by addresses, hence numeric and not string.
... you know all this. Why wouldn't this make sense?
Windows 11, Manjaro, Raspberry Pi OS


Re: Logical NOT Operator (' ! ') in If-statements.
I'm not wanting what you having... There's lot already that doesn't make sense to me, don't need the enhancements.idle wrote:you missed the part, I'm away in the Land of Grey and Pink. otherwise it m@kes sense!

ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
- the.weavster
- Addict
- Posts: 1576
- Joined: Thu Jul 03, 2003 6:53 pm
- Location: England
Re: Logical NOT Operator (' ! ') in If-statements.
And later will you be standing on a golf course, dressed in PVC?idle wrote:you missed the part, I'm away in the Land of Grey and Pink.

Re: Logical NOT Operator (' ! ') in If-statements.
the.weavster wrote:And later will you be standing on a golf course, dressed in PVC?idle wrote:you missed the part, I'm away in the Land of Grey and Pink.

Windows 11, Manjaro, Raspberry Pi OS


Re: Logical NOT Operator (' ! ') in If-statements.
That's boolean on strings - so NOT should work too.Dude wrote:Well, it only shows "b" in the Debug Output for me. So, it works correct here.coder14 wrote:On the flip side this should not work either:But it does.Code: Select all
a.s = "" b.s = "abc" If a : Debug "a" : EndIf If b : Debug "b" : EndIf
Technically if (If a$) is allowed (If Not a$) should be allowed too.