Page 2 of 2

Re: Logical NOT Operator (' ! ') in If-statements.

Posted: Sun Mar 12, 2017 6:04 am
by Dude
coder14 wrote:On the flip side this should not work either:

Code: Select all

a.s = ""
b.s = "abc"
If a : Debug "a" : EndIf
If b : Debug "b" : EndIf
But it does. :lol:
Well, it only shows "b" in the Debug Output for me. So, it works correct here.

Re: Logical NOT Operator (' ! ') in If-statements.

Posted: Sun Mar 12, 2017 6:11 am
by Thunder93
Dude wrote:Well, it only shows "b" in the Debug Output for me. So, it works correct here.
:lol: Same observation and opinion as I had came up with earlier when having seen that.

Re: Logical NOT Operator (' ! ') in If-statements.

Posted: Sun Mar 12, 2017 6:31 am
by idle

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  
m@kes sense doesn't it?

Re: Logical NOT Operator (' ! ') in If-statements.

Posted: Sun Mar 12, 2017 6:36 am
by Thunder93
idle wrote:m@kes sense doesn't it?
It does m@kes sense LOL.

Re: Logical NOT Operator (' ! ') in If-statements.

Posted: Sun Mar 12, 2017 7:19 am
by idle
Thunder93 wrote:
idle wrote:m@kes sense doesn't it?
It does m@kes sense LOL.
it works but I'm not sure if it makes sense, I'm away in the Land of Grey and Pink :mrgreen:

Re: Logical NOT Operator (' ! ') in If-statements.

Posted: Sun Mar 12, 2017 7:32 am
by Thunder93
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? :lol:

Re: Logical NOT Operator (' ! ') in If-statements.

Posted: Sun Mar 12, 2017 7:52 am
by idle
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? :lol:
you missed the part, I'm away in the Land of Grey and Pink. otherwise it m@kes sense!

Re: Logical NOT Operator (' ! ') in If-statements.

Posted: Sun Mar 12, 2017 7:57 am
by Thunder93
idle wrote:you missed the part, I'm away in the Land of Grey and Pink. otherwise it m@kes sense!
I'm not wanting what you having... There's lot already that doesn't make sense to me, don't need the enhancements. :mrgreen:

Re: Logical NOT Operator (' ! ') in If-statements.

Posted: Sun Mar 12, 2017 8:58 am
by the.weavster
idle wrote:you missed the part, I'm away in the Land of Grey and Pink.
And later will you be standing on a golf course, dressed in PVC? :mrgreen:

Re: Logical NOT Operator (' ! ') in If-statements.

Posted: Sun Mar 12, 2017 9:07 am
by idle
the.weavster wrote:
idle wrote:you missed the part, I'm away in the Land of Grey and Pink.
And later will you be standing on a golf course, dressed in PVC? :mrgreen:
:lol: true, it's been known to happen!

Re: Logical NOT Operator (' ! ') in If-statements.

Posted: Mon Mar 13, 2017 2:12 am
by coder14
Dude wrote:
coder14 wrote:On the flip side this should not work either:

Code: Select all

a.s = ""
b.s = "abc"
If a : Debug "a" : EndIf
If b : Debug "b" : EndIf
But it does. :lol:
Well, it only shows "b" in the Debug Output for me. So, it works correct here.
That's boolean on strings - so NOT should work too.

Technically if (If a$) is allowed (If Not a$) should be allowed too.