Sign in to follow this  
spokes2112

XML what I am doing wrong

Recommended Posts

Hi,I am struggling this late night a bit with my xml programming as the newbie I am :-) What I would like to do is show the bitmap under the conditions that vertical speed is above or eq. with 30 and below or eq 59 but I can't get it to work. Anyone that can give me a hint ? Is the "and" wrongly placed?BrgsEugen((A:Vertical speed, feet per minute) 100 / 30 >=) ((A:Vertical speed, feet per minute) 100 / 59 <=) &&

Share this post


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

Thanks Roman!it worked!next problem :-) I am trying to use a string which I can't get to work are the % signs that indicates where the string starts ? -------Here is something wrong I see the if rather than the value:-(%((A:Vertical speed,feet per minute) 100 / int s1)% if{ %(l1 60>= %!1.0f!)% } else { % --- % }I am very thankful for your help :-)BrgdsEugen

Share this post


Link to post
Share on other sites

Eugen, First off, strings are a mystery. Maybe some help, maybe not.The portion:%((A:Vertical speed,feet per minute) 100 / int s1)% ifRegards,RomanProject 737-400

Share this post


Link to post
Share on other sites

Eugen,Disregard last post as I was foolin w/ the HTML stuff here... :-( First off, strings are a mystery. ( At least for me, it's a try & try again thing ) Maybe some help, maybe not.The portion:%((A:Vertical speed,feet per minute) 100 / int s1)% ifYour're lookin for an If/Else statement, but... there is no argument,,, I.E. =, >, <, !, &, || etc,, The if:)% if{ %(May/Should be :%{if}% but there's no argument....The else:else { % --- % }May/Should be :%{else}%----%Again, there's no argument.. Also with If/Else statments some times ( I do "MEAN" sometimes ) an {end} command for the string must be made. ( you can let me know when you find out OK ? :-) )So with all that, take the original : %((A:Vertical speed,feet per minute) 100 / int s1)% if{ %(l1 60>= %!1.0f!)% } else { % --- % } And "maybe" make it :%((A:Vertical speed,feet per minute) 100 / int s1 60 >= )%{if}%(l1)%!1.0f!%{else}% --- %{end}Your mileage may vary, donot operate heavy machinery while working on ... See your doctor about any ill side effects... :-)Note, the way it looks here on the forum is different since HTML has processed it. On paper the " < " would be " & l t ; " , the " > " would be " & g t ; " and the " & " would be " & a m p ; ". All without the quotes and remove spaces between characters.Regards,Roman[link:www.packers.com]GREEN BAY PACKERS][/i :-ukliam :-beerchug

Share this post


Link to post
Share on other sites

Fortunately Strings aren't too mysterious. In General they can consist of two different parts of code: pure strings and value evaluating. E.g. --- is a string to be displayed under certain conditions and ((A:Vertical speed,feet per minute) 100 / int s1 60 >= ) does evaluate a value. Note that a string can contain a combination of these, they are separated by "%". The other big difference to "common" XML alculations are, that "if","else" and "case" are written differently, if they are in the string section. As Roman already said, they are always {if}...{else}...{end} or {case}...{:0}...{:1}....{end}.By the way, This syntax is not only used in <String>s but also in <Tooltip> and for other parameters in ".." , at least for the Color=".." parameter.Arne Bartels

Share this post


Link to post
Share on other sites

>Eugen, >>Disregard last post as I was foolin w/ the HTML stuff >here... :-( >> First off, strings are a mystery. ( At least for me, it's a >try & try again thing ) Maybe some help, maybe not. >>The portion: >%((A:Vertical speed,feet per >minute) 100 / int s1)% if >Your're lookin for an If/Else statement, but... there is no >argument,,, I.E. could it be that if includes a implicit true then relating to earlier evaluation i.e if true then ( font is yellow just an example)but you only wright true. Is this correct understood?> =, >, <, !, &, || etc,, >>The if: >)% if{ %( >May/Should be : >%{if}% > but there's no argument.... >>The else: >else { % --- % } >May/Should be : >%{else}%----% >Again, there's no argument.. >>Also with If/Else statments some times ( I do "MEAN" >sometimes ) an {end} command for the string must be made. ( >you can let me know when you find out OK ? :-) ) Could it be that the end argument "closes" that condition ie you have if else condition within the first condition?See the example string below, Have I totaly missunderstood?String>%((A:Nav1 dme, nmiles) s1 0 >=)%{ifONE}%(l1 100 >=)%{ifTWO}%(l1)%!d!%{elseTWO}%(l1)%!0.1f!%{endTWO%{elseONE}----%{endONE}Best RegardsEugen

Share this post


Link to post
Share on other sites

>>could it be that if includes a implicit true then relating to earlier evaluation i.e if true then ( font is yellow just an example)but you only wright true. Is this correct understood?I assume you can calculate again and write when neceesary.>>See the example string below, Have I totaly missunderstood?String>%((A:Nav1 dme, nmiles) s1 0 >=)%{if}%(l1 100 >=)%{if}%(l1)%!d!%{else}%(l1)%!0.1f!%{end}%{else}%----%{end}No.. not at all. Looks good here. Your mileage may vary.. :-)Regards,Roman[link:www.packers.com]GREEN BAY PACKERS][/i :-ukliam :-beerchug

Share this post


Link to post
Share on other sites

>> >>could it be that if includes a implicit true then >relating to earlier evaluation i.e if true then ( font is >yellow just an example)but you only wright if! not true misstake by me :-) >I assume you can calculate again and write when neceesary. >>>>See the example string below, Have I totaly missunderstood?>>String>%((A:Nav1 dme, nmiles) s1 0 >=)%{if}%(l1 100 >>=)%{if}%(l1)%!d!%{else}%(l1)%!0.1f!%{end}%{else}%----%{end} >>No.. not at all. Looks good here. Your mileage may vary.. What I mean is the usage of end in this string, because you were saying in an earlier post that the usage of end was a bit unclear when to use and and not?BrgdsEugen

Share this post


Link to post
Share on other sites

Eugen, I guess what I am saying is...Yes it can be unclear. The code you have looks good.. ( Logically and following the "rules" ) But it may not work. I have run into strings that just will not work unless the {end} is takin out. Its a toss up, write it correctly the first time and if it doesn't work well.... Try again :-) I would like the "FACTUAL" answer to this too. ( We follow the rules and just can't win.. :-( )Regards,Roman[link:www.packers.com]GREEN BAY PACKERS][/i :-ukliam :-beerchug

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this