Current SPAD.neXt Release: 0.9.12.123
This forum has closed. Please join our Discord Community.
SPAD.neXt online services are no longer available for SPAD.neXt Versions < 0.9.11.5
Custom expression help !
Re: Custom expression help !
Yesterday I went sleeping very late.
I have to look angain this evening, but I’m pretty sure that my last formulea works.
So I’ll come back to confirm that the less or more symbols can be used.
See you!
I have to look angain this evening, but I’m pretty sure that my last formulea works.
So I’ll come back to confirm that the less or more symbols can be used.
See you!
- Oz Flyer
- Betatester
- Posts: 741
- Joined: 23 Sep 2015, 10:10
- Location: YMMB, Melbourne, Australia
- Contact:
- Status: Offline
Re: Custom expression help !
I did try it before posting and it worked as it was my first try at programming expressions had to play with it for some time to get it to work.thedazman wrote: ↑14 Jan 2019, 11:55You can’t use < and > in xml they are reserved for xml tags and as all the programming is stored in xml profiles I’m not sure you can use <> ?
I haven’t done much expression programming with is why I said I can’t advise about expression syntax but would be interested to know if <> works
Daz
Did the lower side first then added the upper after getting one working.
David
OZ Flyer
Near YMMB
40+ year of Flight Siming.
Sim: subLOGIC/Microsoft Flight Sim's/DTG FSX, Microsoft Flight, DTG Filght School/FSW/Train Sim/TSW, ETS2 & ATS.
Hardware: Logitech, Saitek, Arduino 2560's & Leo's, BBI-32, PAC LED.
OZ Flyer
Near YMMB
40+ year of Flight Siming.
Sim: subLOGIC/Microsoft Flight Sim's/DTG FSX, Microsoft Flight, DTG Filght School/FSW/Train Sim/TSW, ETS2 & ATS.
Hardware: Logitech, Saitek, Arduino 2560's & Leo's, BBI-32, PAC LED.
Re: Custom expression help !
Yes, I confirme that"s works fine like that :
Code: Select all
If ( [SIMCONNECT:INDICATED ALTITUDE] >= [SIMCONNECT:AUTOPILOT ALTITUDE LOCK VAR] - 60
&&
[SIMCONNECT:INDICATED ALTITUDE]<= [SIMCONNECT:AUTOPILOT ALTITUDE LOCK VAR] + 60
, 1, 0)
- thedazman
- Betatester
- Posts: 1808
- Joined: 28 Mar 2015, 10:47
- Location: United Kingdom
- Contact:
- Status: Offline
Re: Custom expression help !
Totally different formatting to gauge expressions, I’ll think I’ll stick to gauge xml
I did say I didn’t know SPAD expression syntax but glad I was at least right about using less and greater than over equals.
I did briefly mess with expressions and struggled, but SPAD then added expressions into gauges so I no longer needed to use them in SPAD ergo I’m very rusty
Daz
Daz
I did say I didn’t know SPAD expression syntax but glad I was at least right about using less and greater than over equals.
I did briefly mess with expressions and struggled, but SPAD then added expressions into gauges so I no longer needed to use them in SPAD ergo I’m very rusty
Daz
Daz
- c0nnex
- Site Admin
- Posts: 5469
- Joined: 10 Mar 2015, 21:52
- Location: Munich, Germany
- Contact:
- Status: Offline
Re: Custom expression help !
Code: Select all
If ( [SIMCONNECT:AUTOPILOT ALTITUDE LOCK VAR] > 0
&&
ABS([SIMCONNECT:AUTOPILOT ALTITUDE LOCK VAR] - [SIMCONNECT:INDICATED ALTITUDE]) <= 50,
1,
0
)
Expressions have nothing to do with xml btw
- thedazman
- Betatester
- Posts: 1808
- Joined: 28 Mar 2015, 10:47
- Location: United Kingdom
- Contact:
- Status: Offline
Re: Custom expression help !
Good to know, I know all your config files including profiles are xml based.
Is confusing having two different programming syntax to deal with, I’m still struggling with gauge xml
Daz
Is confusing having two different programming syntax to deal with, I’m still struggling with gauge xml
Daz
- c0nnex
- Site Admin
- Posts: 5469
- Joined: 10 Mar 2015, 21:52
- Location: Munich, Germany
- Contact:
- Status: Offline
Re: Custom expression help !
There is a general diffrence.
Gauges use Polish Notaion ( Operands first then operator e.g. 1 3 > ) , I just use that becasue FSX uses it to stay compatible to standard gauges. I might change this somewhen in future to something more convinient and provide an editor for gauges. As gauges are pure XML currently, you cannot use <> in it.
SPAD.neXt Expressions use normal notation (Evaluated left to right according to binding priority e.g. 1 > 3 )
How thsoe are represented in the Profile-XML is totally irrelevant.
Gauges use Polish Notaion ( Operands first then operator e.g. 1 3 > ) , I just use that becasue FSX uses it to stay compatible to standard gauges. I might change this somewhen in future to something more convinient and provide an editor for gauges. As gauges are pure XML currently, you cannot use <> in it.
SPAD.neXt Expressions use normal notation (Evaluated left to right according to binding priority e.g. 1 > 3 )
How thsoe are represented in the Profile-XML is totally irrelevant.
- thedazman
- Betatester
- Posts: 1808
- Joined: 28 Mar 2015, 10:47
- Location: United Kingdom
- Contact:
- Status: Offline
Re: Custom expression help !
I do have SPAD expression in my gauges too so I do have a mix of code but I can’t code them straight out of my head even though they make more logical sense than the Polish notation. I have to cut and paste example formats and modify them.
Having the same fun with vb.net which I’m teaching myself currently (finally ditched vb6 lol). Written a couple of functional apps in vb.net
I like the idea of the syntax of gauges matching expressions, but the switchover is always a headache to support the transition from old to new.
AND as I’m aging badly I’m struggling to pick up new ways of coding
Daz
Having the same fun with vb.net which I’m teaching myself currently (finally ditched vb6 lol). Written a couple of functional apps in vb.net
I like the idea of the syntax of gauges matching expressions, but the switchover is always a headache to support the transition from old to new.
AND as I’m aging badly I’m struggling to pick up new ways of coding
Daz