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

FSXA Multiple units question

Messages
1,749
Country
unitedstates
The question is why do different types of xml coding still work with any three of these units.
It seems that these units all work with 2 digits or 100 digits.
Bool
Enum
Number

I am opening a thread in this topic to answer this question for everyone.
 
Answer is simple: because LVars have a single data type, double, which only accepts floating point values.

Bool and enum are of integer type in common programming languages; I guess they are maintained as units in LVars just for logical compatibility.

Tom
 
As Tom says, people use Enum and Bool in their L: variables so they know what kind of logic is being used for this particular code. You could use Number for all of them if you wanted to.
 
So from what I have learned over the years you can use any of these units for common values. Listed below is the meanings to best convey the intent of the coder.

1. Bool is best used for off and on modes. 2 values.
2. Enum is best used for when you have a meaning for each value. Enum can have any amount of values.
3. Number is best used when you have numbers as the value. There is no meaning it's just raw data.
 
Last edited:
Back
Top