• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FS2004 [XML] Condiotional string problem

Messages
180
Country
belgium
[XML] Conditional string problem

Hi all

I'm still struggling with my altimeter gauge.
My Altimeter gives me the thousands of feet in 2 digits. But when climbing and the altimeter says 18996 for instance I want to let the first 2 digits jump to 19.
The gauge itself has 2 text areas for the altitude, one with only 2 digits for the thousands of feet and another one which shows the hundreds. As soon as the hundreds reach 995 they automatically switch to 000, but I want the thousands of feet to jump too.

I tried several things but after a few tries where I got a value visible but not the correct one I now ended up with the thousands not showing up any more ...

Code:
<String>%((A:Indicated Altitude, feet)((A:Indicated Altitude, feet) 1000 / ) - 95 >= )
	     %{if}%((A:Indicated Altitude, feet) 1000 / near )%!2d!
	     %{else}%((A:Indicated Altitude, feet) 1000 / flr )%!2d!%{end}
</String>

can some one explain me what I'm doing wrong?
 
Last edited:
Okay, I the code to show a number again, but after checking it it seems to always take the "else"

Code:
%((A:Indicated Altitude, feet)((A:Indicated Altitude, feet) 100 / flr 100 *)- 95 >= )%{if}%((A:Indicated Altitude, feet) 1000 / flr 1 + )%!2d!%{else}%((A:Indicated Altitude, feet) 1000 / flr )%!2d!%{end}

If I translated correctly I started with this:
e.g.: 1996ft / 100 => 19.96ft flr => 19ft * 100 => 1900ft
=> 1996ft - 1900ft = 96ft >= 95 => true => 1996ft / 1000 = 1.996 flr = 1 + 1 = 2

but it still shows 1 :confused:
 
and another new issue shows up
after altering the code a bit it now seems to stick on the if ...
Code:
%(((A:Indicated Altitude, feet)((A:Indicated Altitude, feet) 1000 / flr 1000 *) - ) (995) >= )%{if}%((A:Indicated Altitude, feet) 1000 / flr 1 + )%!2d!%{else}%((A:Indicated Altitude, feet) 1000 / flr )%!2d!%{end}
 
Last edited:
figured it our myself already xD
lots of trial and error with some textareas to show test/check values
Code:
%((A:Indicated Altitude, feet) 1000 %  995 >= )%{if}%((A:Indicated Altitude, feet) 1000 / )%!2d!%{else}%((A:Indicated Altitude, feet) 1000 / flr )%!2d!%{end}
 
hehe no problem.
just wondering why it doesn't accept a subtraction of an A value with an A value on which calculations were processed. It just seems to take the first A value and use that as the condition ...
 
Ahh.. Well note that you have to use Polish phrase techniques (and French), so to make a number value negative, you must put /-/ after the number (with one space between the group) and that will make a sum 'negative'. You probably knew that though.
 
Hi,

You did not have the correct formatting, I believe.

This is not valid:

Code:
%(((A:Indicated Altitude, feet)((A:Indicated Altitude, feet) 1000 / flr 1000 *) - ) (995) >= )

Since:

1. Inside the second set of parentheses you have:

Code:
((A:Indicated Altitude, feet) 1000 / flr 1000 *) - )

What is the minus sign doing? It's acting on nothing.

Also, there should not be parentheses around the (995). Also, there must be a space before and after a *. Perhaps you mean something like?:

Code:
%((A:Indicated Altitude, feet)((A:Indicated Altitude, feet) 1000 / flr 1000 * ) -  995 >= )

Hope this helps,
 
Is it that you never have more then 2 brackets at a time or can you have three in a row in the front; such as (((

Are they handled like curly brackets, if you have 3 { then you must have 3 } ?



Bill
 
Bill, the real answer is to use a many as you absolutely need...

And yes, every ( or { must have a matching } or ).

Truthfully, this is not only unnecessary, but it may not work at all. For some reason XML doesn't really like unneeded "nested parenthesis":

Code:
%((A:Indicated Altitude, feet) ((A:Indicated Altitude, feet) 1000 / flr 1000 * ) -  995 >= )

This however will work:

Code:
%((A:Indicated Altitude, feet) (A:Indicated Altitude, feet) 1000 / flr 1000 * - 995 >= )

Note that the only difference is that I've removed the nested parenthesis from the second expression. XML will parse the operands in reverse order anyway.
 
Back
Top