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

IF Statements

No, it certainly won't. The solution is posted in your other thread on the same subject matter.
 
I see that these have a 'condition' that must be a first string on these, yes? Can they be anything else then a 'condition'?

No. It has to be a boolean result.
Can the condition be roughly stated, such as;
<Value>EXIT OPEN
.....if/else bits.....
</Value>

(sort of like <Value>EXIT OPEN</Value>

Or does it need to be something like
<Value>
(A:EXIT OPEN,percent) 100
....if/els bits.....
</Value>

No, it has to be done properly, as in:

Code:
(A:EXIT OPEN,percent) 100 [COLOR="Red"]==[/COLOR]

Because the result must be a boolean.

Next question..

Can you have the same condition in the front, as you have in the if/else sections, or will that cut the system out, cause it to not function?

For instance,

<Value>
(A:EXIT OPEN,percent) 100
if{ (EXIT OPEN,percent) 100
2 (&gt;L:XMLSND64,enum) }
els{ (EXIT OPEN,percent) 0
3 (&gt;L:XMLSND64,enum) }

Above, note that EXIT OPEN is depicted 3X, top, if, and els sections. Is that 'ok' or does that kill a if/els?

No, that's fine, so long as you actually do it correctly in the first place as I described above.

Third, (sorry, so many questions)

Is there a rule on if/els amounts? Can I have 1 if and 3 els'?

You can either have an if, or an if paired with an else. No other combination.

Fourth, (yep)

Do you have to have a first condition? or can I go straight to if/els scenarios? It makes sense to me, not knowing how a basic if/els works, that I should just right a if, then els, instead of the opening condition. That makes no sense to me whatsoever, except to have another condition. If I have one condition, then it should just be if/els instead. But I do not fully fathom this equasion or logic.

Not sure what you mean, but you must have a boolean condition out in front of the if else... otherwise how will it know if to do the if or the else?:)

THE SIMPLE RULE:

(Some sort of condition which evaluates to true or false) if{ (Stuff to do if the condition is true) }

OR

(Some sort of condition which evaluates to true or false) if{ (Stuff to do if the condition is true) } els{ (Stuff to do if the condition is false) }


You can do what you like in the condition, so long as it ends up as true or false, and then you can do what you like in the stuff that gets done. Within reason, of course!
 
Last edited:
Many thanks FOJ for the tutorial on if/els.

Digesting this. Its good to know the rules of how this operates.

Thanks again and thanks for your patience.


Bill
 
FOJ,

I just tried that; adding the two == on the end of 100 percent, and....


IT WORKS!!!!!!!!!!!


A thousand thanks man....!

So, I had thought == was reserved for 'enum' operations.... ? They must have a dual meaning? or does == mean to execute?
 
Glad it worked. :)

== has nothing to do with enums and it doesn't mean execute. It is a comparison operator. It takes two inputs, and outputs a true/false boolean.

Code:
Value1 Value2 ==
Will return true if Value 1 and Value 2 are the same, and false otherwise.

So
Code:
(A:EXIT OPEN,percent) 100 ==

returns true when EXIT OPEN is 100, and false when it isn't. This Boolean value then gets fed into the if to decide if/else.
 
Last edited:
Lionheart, seriously, I think you should have a look at this page, particularly tutorials one through to three:

http://www.fs2x.com/Tutorials.htm

I think you need to get a handle on some basic concepts of operators, stacks and organising XML scripts. No offense intended, but those are good tutorials for XML code - they will help you see through all the confusion!
 
Last edited:
== has nothing to do with enums and it doesn't mean execute. It is a comparison operator. It takes two inputs, and outputs a true/false boolean.

Or, putting in simpler terms, == means "equals" in the same way that && means "and"... :teacher:

Bill O., be thankful your working with XML syntax, and not C... :D

Where = and == mean two entirely different things altogether! :yikes:
 
Back
Top