Subject: | Re: Operator precedence
| Date: | Thu, 7 Sep 2017 03:56:48 +1000
| From: | Bernie van't Hof <berniev@bje.com.au>
| Newsgroups: | pnews.paradox-dos
|
Thanks, Mike.
What I realised in the mean-time ..
php has precedence of ! (NOT) above all those on your list except ()
So
IF NOT Retval = "Esc" ; which works fine
does not become
if( ! $Retval == 'Esc') // valid php but wrong result!
it should be
if( ! ($Retval == 'Esc'))
I used the above pal construct only twice in 30k lines of pal, more
commonly using
IF Retval <> "Esc"
which converts nicely to
if($Retval <> 'Esc')
so I didn't spot it in earlier run-time testing.
-B
On 7/9/17 2:10 am, Michael Kennedy wrote:
> The manuals say:
> () - Inner pairs first
> (All the following are Left-to-Right]...
> * /
> + -
> = <> < <= > >=
> NOT
> AND
> OR
>
> ...all as expected...
>
> There's no mention of that darn "unary minus", nor of different contexts
> of "NOT", etc...
>
> I assume that PDoxDOS represents (1=2), [False], internally as 0, but I
> don't recall how it represents (1=1) [True, = NOT False]. I think most
> systems use "-1", but some systems use just "1", and maybe some use "any
> non-zero value"?.....
>
> - Mike
>
>
> On 04/09/2017 18:40, Bernie van't Hof wrote:
>> Anyone have handy a operator precedence list for PDOX DOS?
>>
>> Having an issue with 'NOT' and darned if I can see why.
>>
>> Thanks,
>> B
|