Peer support for Air Manager desktop users

Moderators: russ, Ralph

Message
Author
DrDave-
Posts: 6
Joined: Sun Apr 11, 2021 4:01 pm

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

Ralph
Posts: 7915
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

### Re: Advice on Lie syntax

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.

jph
Posts: 2852
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

### Re: Advice on Lie syntax

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
Joe. CISSP, MSc.