Page 1 of 1

Advice on Lie syntax

Posted: Sun Feb 18, 2024 9:05 pm
by DrDave-
Please help.Cannot find an explanation.

Two codings:
1. Coding - var = fif(var, ...... What is the fif( and what are the parameters?

2. In the function call "callupdate(mode, alt, art ~ 1, ....".
"art ~ 1" is a param passed to the function. Can this be interpreted as "pass the param if is not equal to 1". Is this right? If it is, what happens if it is equal to one? What is this code?

Can't find the above they search.

Thanks

Re: Advice on Lie syntax

Posted: Mon Feb 19, 2024 6:29 am
by Ralph
Fif, function in function it was I think.
Bla = fif(true, var1, var2) -- Bla will be var1
Bla = fif(false, var1, var2) -- Bla will be var2

I'm not sure what you mean by question 2, I've never seen this. But I'm no Lua expert.

Re: Advice on Lie syntax

Posted: Mon Feb 19, 2024 10:20 am
by jph
Hi
the reason you can't find FIF on a LUA search is that it is not native LUA - it is a small function used in air manager. You can find them all in the directory Air Manager/ Lua Libs


"art ~ 1" is simply the variable art bitwise XOR'ed with 1 where the tilde ~ IS a standard lua bitwise operator

Often used to 'flip' a 1 to 0 or a 0 to 1
Joe