[Gambas-user] Problem with finished Shell Process.State <> Process.Stopped
BB
adamnt42 at gmail.com
Mon Feb 27 08:41:37 CET 2023
On 27/2/23 3:14 pm, T Lee Davidson wrote:
> On 2/26/23 23:40, Bruce Steers wrote:
>> Almost as much as misplacing the Not in a test
>> If Not sString Begins "Something" Then
>> Print "Damn it!! 'Not' is in the wrong place and has only tested
>> if the string exists and I will need bug hunt this! :-\"
>> Endif
>
> Funny!
Actually, I don't think it's that funny at all. The help says:
NOT
_Result_ *= NOT* _Expression_
Computes the logical not of an expression.
The logical NOT operator takes one boolean expression and returns its
contrary.
*
*
*Why does Gambas interpret the _predicate_ to be the
*_*String*__**__*object*_*and not the expression?* /sString /is not a
boolean expression, /sString begins "Something" /is one.
The Not is acting as an operator rather than a logical condition , which
is fine when we want to operate on some thing outside a logical
condition, such as in xyzzy.Visible = not xyzzyVisible. But not so when
it is used in a logical condition. Other examples are:
If Not A or B ...
If Not A and C or Not B and C ...
If Not A or Not B and C ..
etc.
If I really want to use Not as an operator in a logical expression then
Gambas should force me to use "If Not(thing) and/or/=/Is/...
Of course, changing this at this stage of the language maturity would
possibly break uncountable code but would it?
Just my (ever devaluing) 2 cents worth.
b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230227/41992177/attachment.htm>
More information about the User
mailing list