• 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.

FS2004 testing a negative number

Messages
1,468
Country
italy
Code:
(L:xwind,number) -9 < (L:xwind,number) 9 > |
Is this correct to show 10kts or more either way or should the first part be (L:xwind,number) -9 >
many thanks
 
Code:
(L:xwind,number) -9 < abs
(L:xwind,number) 9 > or

Should return >9.1 in either case.
 
Code:
(L:xwind,number) -9 < (L:xwind,number) 9 > |
Is this correct to show 10kts or more either way or should the first part be (L:xwind,number) -9 >
many thanks

First I don't understand why you are testing the variable L:xwind bitwise with "|"
If you just want to test if L:xwind is less than -9 or greater than 9, use "||" which is the logical operator "or".
Code:
(L:xwind,number) -9 < (L:xwind,number) 9 > ||
You should also achieve the same results with
Code:
(L:xwind,number) abs 9 >
which compares the absolute value of L:xwind with 9. If greater is true, if less than, it will be false.
 
Code:
(L:xwind,number) -9 < abs
(L:xwind,number) 9 > or

Should return >9.1 in either case.

The reason for the positive and negative numbers is that +9 equals a cross wind of 9kts from one side of the aircraft -9 is 9knots from the other side.
So does (L:xwind,number) -9 < return a positive number greater than 9 or a negative number? I want ot test for example if (L:xwind,number) is -15
so should I use > on both sides of the test?
 
Thanks Tom. The correct syntax would be for the second option <Value>-9 9 (L:xwind,number) rng !</Value>
 
The first line of code is equally valid.

If L: variable is greater than 9, then this is true. If L: variable is less than -9 then the absolute value will be greater than 9. Again, it is true.

abs = if positive number, do nothing. If negative number, make it a positive number (remove the -).
 
Back
Top