• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

What Does & Mean?

Messages
10,158
Country
us-arizona
Hey guys,


What does & mean by chance? I know that & means 'and', but amp has wondering.


Many thanks,

Bill
LHC
 
Bill,

Do you mean.

Bit Operators

& bitwise AND

where 3 5 & gives 1
Code:
   0000001[COLOR="Red"]1[/COLOR]
 & 0000010[COLOR="red"]1[/COLOR] 
 gives
   00000001

The bits in each position in the first number (chr) must match bits in each position in the second number. Here only the ones in red.

The other position either have 0 and 0 equals 0 or 1 and 0 equals 0. But the last position has 1 and 1 equals 1.
 
Last edited:
:yikes:

<--- re-reads your post three more times..

I have no idea. I was hoping it was just a simple meaning, like &gt; has...

:(


Bill
 
Would you like more explanation - or would you just rather skip it.

Did you come across this in one of ACES guages and wanted to know how it worked?

Come on you must have counted in binary as a kid:p

zero
one
ten
eleven
one hundred
one hundred and one
one hundred and ten
one hundred and eleven
....

Let me explain OR to you ......

No No make him stop ... I'll talk, I'll talk
 
Ron - I may have known what the AND operator meant - a long time ago - in college.

so using your example, 3,5 OR gives me "6" ?
Code:
    00000[COLOR="Red"]1[/COLOR]1
 OR 0000[COLOR="red"]1[/COLOR]01 
 gives
   00000[COLOR="red"]11[/COLOR]0
 
Hey guys,
What does &amp; mean by chance? I know that & means 'and', but amp has wondering.
Many thanks,

Bill
LHC

While Ron is "technically correct," I'm assuming that you simply wanted to know the following: ;)

&amp; is just the "full way" of writing the "&" symbol...

...just like &gt: is the "full way" of writing ">"...

(Hint: the symbol is called an "ampersand" or "amp" for short!)

In FS XML syntax, it is used like this:

&& is the same as &amp;&amp is the same as and

I just explained this in another post about a week ago... :mischievo
 
Last edited:
so using your example, 3,5 OR gives me "6" ?

Not quite, :)

You did XOR - exclusive OR

You compare the bits vertically - in my examples

Code:
       |
       \/
00[COLOR="Blue"]0[/COLOR][COLOR="Cyan"]0[/COLOR][COLOR="Yellow"]0[/COLOR][COLOR="Magenta"]0[/COLOR]0[COLOR="Red"]1[/COLOR]
00[COLOR="blue"]0[/COLOR][COLOR="cyan"]0[/COLOR][COLOR="yellow"]1[/COLOR][COLOR="magenta"]0[/COLOR]0[COLOR="Red"]0[/COLOR]

You get the picture.

OR (|) is

A 1 OR 0 is 1
A 0 OR 1 is 1
A 1 OR 1 is 1
A 0 OR 0 is 0

Code:
   00000[COLOR="Red"]011[/COLOR]   - 3
 | 00000[COLOR="red"]101[/COLOR]   - 5 
 gives
   00000[COLOR="red"]111[/COLOR]   - 7

XOR (^) is

A 1 OR 0 is 1
A 0 OR 1 is 1
A 1 OR 1 is 0 <- exclusive OR means one or the other can be a 1 but not both bits.
A 0 OR 0 is 0

Code:
   00000[COLOR="Red"]011[/COLOR]   - 3
 ^ 00000[COLOR="red"]101[/COLOR]   - 5 
 gives
   00000[COLOR="red"]110[/COLOR]   - 6

Back to AND (&)

A 1 AND 0 is 0
A 0 AND 1 is 0
A 0 AND 0 is 0
A 1 AND 1 is 1 (both bits must be 1 to result in a 1)

Code:
   00000[COLOR="Red"]011[/COLOR]   - 3
 & 00000[COLOR="red"]101[/COLOR]   - 5 
 gives
   00000[COLOR="red"]001[/COLOR]   - 1

I think I have wasted enough 1s and 0s on this thread now.:D
 
Last edited:
Here is a complete list of FS XML operators, functions and modifiers, as published by Arne Bartels* many years ago:
+ (binary operator) : adds the last two stack entries
- (binary operator) : subtracts the last two stack entries
* (binary operator) : multiplies the last two stack entries
/ (binary operator) : divides the last two stack entries
% (binary operator) : remainder divides the last two stack entries
/-/ (unary operator) : reverses sign of last stack entry
-- (unary operator) : decrements last stack entry
++ (unary operator) : increments last stack entry

&gt; (binary operator) : ”>” gives 1 if last stack entry is greater than forelast stack entry
&lt; (binary operator) : ”<” gives 1 if last stack entry is smaller than forelast stack entry

&gt=; (binary operator) : ”>=” gives 1 if last stack entry is greater than or equal to forelast stack entry
&lt=; (binary operator) : ”<=” gives 1 if last stack entry is smaller than or equal to forelast stack entry
== (binary operator) : gives 1 if both last last stack entries are equal
&amp;&amp; (binary operator) : ”&&” logical AND, if both last stack entries are 1 gives 1 otherwise 0
|| (binary operator) : logical OR, if one of the last stack entries is 1 result is 1 otherwise 0
! (unary operator) : logical NOT, toggles last stack entry from 1 to 0 or 0 to 1
? (ternary operator) : ”short if-statement”, if the last entry is 1, the forelast entry is used, else the fore-forelast (or the other way round. Try it, see it)

&amp; (binary operator) : ”&” bitwise AND
| (binary operator) : bitwise OR
~ (unary operator) : bitwise NOT, toggles all bits
&lt;&lt; (binary operator) : ”<<” shift bits of forelast stack entry by last stack steps to the left
&gt;&gt; (binary operator) : ”>>” shift bits of forelast stack entry by last stack steps to the right

d : duplicates last stack entry
r : swaps last two stack entries
s0,s1,s2,.. : stores last stack entry in storage for later use
sp0,sp1,sp2,... : (presumably) the same as above
l0,l1,l2,... : loads value from storage and places on top of stack

abs (unary operator) : returns absolute value (removes ”–”)
int (unary operator) : cuts away digits after decimal
near (unary operator) : rounds to nearest integer
flr (unary operator) : gives next smallest integer
dnor (unary operator) : normalizes degrees (all values are ”wrapped round the circle” to 0°-360°)
rnor (unary operator) : normalizes radians (all values are ”wrapped round the circle” to 0-2p) (NOTE: doesn’t work too reliable)
dgrd (unary operator) : converts degrees to radians (also rddg available?)
pi : places p on top of stack
atg2 (binary operator) : gives atan2 in radians (other trigonometric functions? sin,cos,tg? Other functions? sqrt, ln?)
max (binary operator) : gives the greater of last two stack entries
min (binary operator) : gives the smaller of last two stack entries

others:
if{ ... } if last stack entry is 1, the code inside the brackets is executed (note that there is no SPACE between ”if” and ”{” but one after it and at least one SPACE before ”}”)
if{ ... } els{ ... } if last stack entry is 1, the code inside the brackets is executed, else the code in the second set of brackets (take also care to where SPACEs are allowed and where not)
quit leaves the execution immediately, last stack entry is used for further purposes
case hard to describe, therefore an example:

30 25 20 10 5 1 0 7 (A:Flaps handle index, number) case

the numbers 30 25 20 10 5 1 0 are pushed down the stack, 7 says how much entries, based on the result of (A:Flaps handle index, number) ”case” extracts one of the seven numbers. If (A:Flaps handle index, number) is 0 -> 0, 1->1, 2->5,... 6->30.

* Arne's complete article may be downloaded from avsim.com:
http://library.avsim.net/search.php?SearchTerm=xmlgau01.zip&CatID=root
 
Last edited:
Just wanted to throw in here that those various things that start with & aren't FSX specific, those are standard XML nomenclature, basically they are escape sequences (similar to things that start with a \ in C/C++ strings), since & is the start char for an escape sequence, you have to use &amp; to denote an actual ampersand, &gt; and &lt; are needed since < and > are special delimiters in XML, etc.
 
Here is where one of Fr Bill's examples for &amp; It's in ACES PFD XML code (g1000.cab!g1000_pfd.xml). At first I thought this was a bug but now see it's not a bug it's just the long way to do it.

Code:
                <Macro id="PFDBlinkerCode" Name="PFDBlinkerCode">
                    <MacroValue>(@g:menuBlinker) d 0 &gt; if{ -- (&gt;@g:menuBlinker) 15 sp0 1 } els{ l0 -- s0 d 0 [COLOR="Red"]&amp;lt;[/COLOR]= if{ 30 sp0 } 15 &gt; }</MacroValue>
                </Macro>

notice the &amp;lt;

to represent

&lt;


I wonder if &amp;amp;lt; works too. ;)

Felix, can you remember Karnaugh maps (NRN)
 
&gt; and &lt; are needed since < and > are special delimiters in XML, etc.

Thanks, Tim.

Curiously though, > will work just as well as &gt;

However, under no circumstances will < ever work instead of &lt;

Don't ya just LOVE the inconsistency! :D
 
May I ask how you guys are writing (typing) that one symbol that looks like a fat capital I symbol?

Example; Quote from above list by Fr. Bill;
l0,l1,l2,... : loads value from storage and places on top of stack

Some are very thick. Just wondering how that is done. (Note that with a copy/paste, mine did not appear thick as like it is above).


Bill
 
The | symbol may appear in different place on different regional keyboards.

On a UK keyboard it is shift + \

| means bitwise OR, || means logical OR.

Si
 
Thanks Simon.

It looks like a machine code symbol on my Notepad font. Was wondering how people type it in.



Bill
LHC
 
May I ask how you guys are writing (typing) that one symbol that looks like a fat capital I symbol?

Example; Quote from above list by Fr. Bill;
l0,l1,l2,... : loads value from storage and places on top of stack

Some are very thick. Just wondering how that is done. (Note that with a copy/paste, mine did not appear thick as like it is above).

In the case above though, that is a lowercase L...

l0,l1,l2,... : loads value from storage and places on top of stack

Hint: "Load" is the key word...

l0 = lowercase L + 0

|0 would be incorrect!
 
Back
Top