• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

FSXA Multiple units question

#1
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.
 

taguilo

Resource contributor
#2
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
 
#3
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.
 
#4
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: