MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
TheGerman
Posts: 9
Question regarding transform formula. I am trying to get the over/under speed indicator displayed. I set a variable (#) that equals 1 for overspeed "B", 2 for underspeed "A"
When trying to use this formula below it fails, when leaving the second if-clause out, no problem. Multiple if-clauses not allowed? Any thoughts on how to do it differently?

if(#=1,'B'+$,if(#=2,'A'+$,$),$)
2023-01-28 23:10
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
It should work.... But you would need a Left Padding Space OR you would need to use a "Space" in case if non Over or Underspeed is On.

Your issue in the quoted Code.... You got one ,$ to much....

Yours: if(#=1,'B'+$,if(#=2,'A'+$,$),$)
Correct is: if(#=1,'B'+$,if(#=2,'A'+$,$))
Syntax is ... if(Indication1,THEN,if(Indication2,THEN,ELSE))
So the initial IF not have a own ELSE.... Cause the second IF represent the ELSE of the first.

I´m for now not 100% shure whats the best Syntax..... Also NOTE: We did a segnificant change here.... Its recommend to use MF 9.6.0.5 BETA here. Some Issues come into System with 9.6.0 We already fix in the Beta.

i would use for testing: if(#=1,'B$',if(#=2,'A$',$))

To include the "Space" you can simply add a Space next to the last Dollar.... Cause without Over or Underspeed the Digit must be Empty.
So.... if(#=1,'B$',if(#=2,'A$',' $))

********
Much more straight forward would be to do the B-A-Space already in the Config where you read it....

So in that Config you could say .... if($=0,' ',if($=1,'B','A'))
Then you must use in the Display config only placeholder # for the refference to other Config and you say in transform '#$'
Good Luck !
2023-01-29 00:44
icon