May 7, 201016 yr Moderator I have the following, which works just fine: %((L:VSButtonDown,bool) 0 ==)%{if}%((A:AUTOPILOT ALTITUDE LOCK VAR, feet) 100 / )%!3d!00%{end}% but gives only this for the display:14500I need to have the comma, like this:14,500Any suggestions? :) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
May 7, 201016 yr Bill, You will probably have to have an if/else for 2 different displays, 1 for under 1000 ft & one for over ( includes comma ). For the comma use 0x2c, decimal 44. %!3d!,00%{end}% -- over 1000%!3d!00%{end}% --- under 1000 without code box it looks like this -- comma is parsed.%!3d!,00%{end}% -- over 1000%!3d!00%{end}% --- under 1000EDIT--- BUMMER!! IT PARSES IN THE CODEBOX TOO!! Use the following minus the spaces.. I have spaces in this post to keep it from parsing..& # 4 4 ;ampersand number forty four semi-colonNot tested, but taken from one of Arne's older Lat/Lon example codes and using Character Map to find the hex number equivalent for the comma.Hope it helps,Roman FS RTWR SHRS F-111 JoinFS Little Navmap
May 7, 201016 yr Author Moderator Thanks for the reply, Roman.I have however figured out how to achive the desired result using the <FormatedText> syntax: <Element> <Position X="186" Y="11"/> <FormattedText X="170" Y="36" FontSize="32" Font="DS-Digital Bold Italic" Adjust="Right" VerticalAdjust="Top" Color="#EC802F" Bright="Yes"> <String> %{if}%((A:AUTOPILOT ALTITUDE LOCK VAR, feet) 1000 / int )%!2d! %, %((A:AUTOPILOT ALTITUDE LOCK VAR, feet) (A:AUTOPILOT ALTITUDE LOCK VAR, feet) 1000 / int 1000 * - )%!03d!%{end} </String> </FormattedText> </Element> The answer was of course staring me in the face all along.The first % evaluation returns the "thousands" portionThe second % evaluation places the commaThe third % evaluation multiplies the first % evaluation by 1000, then subtracts it from the complete altitude, leaving the "hundreds" remainder, then displays the result as an integer with leading 0's for padding.In retrospect, it's really quite simple... :(There is actually a bit more to the <FormattedText> string display, as it is a "multi-purpose" area where one of three bits of information may be selectively displayed. normally: pre-selected altitudewhen VS Up/Dn buttons are used: vertical speed setwhen BARO function active: barometric pressure in InHg Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
May 8, 201016 yr Bill, That "formatted text" is a powerful tool and so? Kinda thaught you where stuck in both formats. Never knew you could get away with a comma in "formatted" cuz tis might not be allowed otherwise. Good call.Roman FS RTWR SHRS F-111 JoinFS Little Navmap
May 8, 201016 yr Author Moderator Yes, <FormattedText> is extremely powerful! In fact, I've given up using the more simplistic and pedestrian <Text> function entirely!It is however, a real PITA to get working properly, since any minor "error" (such as a missing space, misplaced comma, missing ! or such) will cause the entire gauge to "fail to display."That is why it is critically important to have FS9 or FSX running, and make only minor changes, save and reload user aircraft to observe the result in real time... :( That is also why I will only create/edit XML scripts using Visual Studio, as the "Intellisense" function will provide instant feedback in the editor if there are any detectable formatting errors...VS will also automatically "format" the indents when creating new entries, auto-close all <tags> for you, and will re-factor the formatting for the entire script using Ctrl-A, Ctrl-X, Ctrl-V (copyall, cut, pasteall). Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
Create an account or sign in to comment