Archived

This topic is now archived and is closed to further replies.

pve

Loop command fs9 XML

Recommended Posts

Hi all Is it possible to loop a list of Vars. Scroll Y Loop %((Var1) (Var2) etc. )%!d% Etc.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi,For Eicas warnings, advisory's etc. I use .Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

I am trying to get a list values out of a macro or group of vars. to show in a scrollable list. (L:Scroll,number) %( 10 s2 0 !=) %{if} %(0 sp1) %{loop} %(l1 (>MacroWithListofValues or numbers)) %((L:Values,number))%!d! %((L:,%(l1 ++ s1 l2 <) etc. Not sure how they do it with the gps ie. (>@c:FlightPlanWaypointIndex). Can a macro hold a list of values or numbers. I need to be able to scroll it.

Share this post


Link to post
Share on other sites

Paul, I still don't get you very well on what you want to do, and what means to you "a list of values or numbers", but I guess what you need is to print the value of each var in a single line, one beside the other, and then scroll the entire line?Something like this, maybe?%(0 sp1) // s1-l1 is the index %{loop}%( @ArrayOfValues ) // Is an array that retrieves the proper var according to l1 index passed and put in , ie, s3%(l3)%!d! // l3 is the value returned by the array%(l1 ++ s1 l2 < )%{next}Tom

Share this post


Link to post
Share on other sites

Hi Tom Yes that's it, Not sure how to setup the @arrayOfValues macro. Paul

Share this post


Link to post
Share on other sites

You could use an approach similar to this:l1 @1 == if{ (L:MyVar:@1,unit) sp3 }@AInd(0) @AInd(1) @AInd(2) @AInd(3) ... @AInd(n) ....%(0 sp1) // s1-l1 is the index %{loop}%( @Array ) %(l3)%!d! // l3 is the value returned by the array%(l1 ++ s1 l2 < )%{next}You may use the : after the name of each Lvar like:(L:MyVar:0,unit)(L:MyVar:1,unit)etcor this method directly:(L:MyVar0,unit)(L:MyVar1,unit)in this case the macro expression is (L:MyVar@1,unit)Should work fine for a limited number of array members (10-20)Tom

Share this post


Link to post
Share on other sites

Tom Thanks, Up to 20 vars will work OK. I will try both solutions. Paul

Share this post


Link to post
Share on other sites

Hi Tom Back on this now. Got it all working OK but I need to keep all the array values to use again later after loading. How can I do this? Paul

Share this post


Link to post
Share on other sites

Hi Paul,So, you just need the vars to be initialized at startup? Could you give me an example?Tom

Share this post


Link to post
Share on other sites

Tom Using this:- (L:Display,number) @1 == if{ @WPtNameSend@1 } puts macros value into array @AInd(0) @AInd(1) @AInd(2) @AInd(3) @AInd(4) @AInd(5) @AInd(6) @AInd(7) Then need to store value in each array macro and retrieve in order (1 to n) when needed.Can it be done? Paul

Share this post


Link to post
Share on other sites

Something like this?(value) (>L:MyArray:@1,unit)@Assign(1) @Assign(2) @Assign(3) etc Many things can be done with these pseudoarrays; if you need a selectable condition for each array member, the best option is to use a "goto" operator within a script, like(start value) s0:0(Evaluate the macro) (l0 ++ s0 (bound) <= if{ g0 }etcTom

Share this post


Link to post
Share on other sites