Correct, in terms of operator precedence it's like you say. Within the same group of operators the default is left to right, soPeterH wrote:OK - two themes here.
Order of precedence: this is the sequence in that operators are resolved - no matter how they are parsed. (The latter is Don's job programming the logic - while we, the users, want to know how our statements are interpreted.)
I just had a look at php, it says:
< and > are lower than + and -, all these are lower than * and /
That is:
$a = 3 < 4 + 5 * 6; / should be same as
$a = 3 < (4 + (5 * 6)); / or am I wrong?
echo 3 > 2 == 2; // 1 == 2 = 0
echo (3 > 2) == 2; // same
echo 3 > (2 == 2); // 3 > 1 = 1
It's not possible to solve. My last attempt to solve it (by surrounding comparison operators with blanks) was not welcomed by forum users - and rightly so!PeterH wrote: The other point is <date w>
I was afraid you said you have a "technical" problem on parsing. I do understand it in some way - but it still is wrong - as jacky said.
3 possible solutions:
- you say "it's this way"
- you do more programming to solve those problems
- you don't use such variables.
In this case maybe the last version is the best? Why not use a function date('w')?
This is the state of the art and I don't see anything better:
Code: Select all
v7.60.0010 - 2008-09-15 22:08
* Scripting: It is not necessary anymore (but allowed) to surround
comparison operators with blanks.
However, to avoid ambiguities in parsing, you have to put XY
internal variables (<curpath>, <xyver>...) within doubled quotes
strings _IF_ they are to be interpolated!
::msg <xypath>; = okay, variable is isolated
::msg "<xypath>"; = okay, variable is isolated & quoted
::msg "XY = ".<xypath>; = okay, variable is isolated
::msg XY = <xypath>; = NOT okay, variable is interpolated
but not quoted
::msg "XY = <xypath>"; = okay, variable is interpolated &
quotedI still say: the recommended way to use XY vars in scripting is: quote them!
XYplorer Beta Club