• 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 Knotty string problem

Messages
1,468
Country
italy
The code below shows the variable value 1 less that it is.
Code:
<String>%((L:P7_limit,enum) d)%{if}%!s!%{else}-%{end}</String>
For example the calculated value of (L: P7_limit,enum) is 56 but the string code
displays 55. What's wrong?

Also I've noticed that (A:AMBIENT PRESSURE,inHg) underreads by 1 when the pressure is say 29.92 it displays 28.92 weird!
 
Hi Volo,

Is this the problem: a rounding issue together with a display width that is too narrow? What is your FormattedText X=" " value? If is is just wide enough for 2 digits only of display, then Heretic's suggestion of !d! should solve it but !f! might not.

If the L:Var is actually 55.7, and you are able to display only two digits, then !s! and !f! will show 55 and !d! will show 56.

Bob

[edit] In case that turns out to be the issue, I add the following.

Do you use a BackgroundColor="something" in FormattedText? Sometimes I do, and choose a color different than the gauge background so that I can see the actual display area for my string.

In the attached pic, the gauge FillColor is "gainsboro", a very light gray shade, and I choose FormattedText BackgroundColor="gainsbor" ... the same color but with the last letter deleted which turns it lime green. When I'm happy with the size, then I add the add the trailing "o" back in.

In each case in the pic below, the <String> is the same as your example and the L:Var always=55.7. If I use !d! format, then all results will be 56

If Text is used rather than FormattedText, its the same issue. X=" " must be wide enough and BackgroundColor can check it.

upload_2015-7-24_20-0-22.png
 

Attachments

  • upload_2015-7-24_19-54-43.png
    upload_2015-7-24_19-54-43.png
    19.8 KB · Views: 450
Last edited:
Hi Volo,

Is this the problem: a rounding issue together with a display width that is too narrow? What is your FormattedText X=" " value? If is is just wide enough for 2 digits only of display, then Heretic's suggestion of !d! should solve it but !f! might not.

If the L:Var is actually 55.7, and you are able to display only two digits, then !s! and !f! will show 55 and !d! will show 56.

Bob

[edit] In case that turns out to be the issue, I add the following.

Do you use a BackgroundColor="something" in FormattedText? Sometimes I do, and choose a color different than the gauge background so that I can see the actual display area for my string.

In the attached pic, the gauge FillColor is "gainsboro", a very light gray shade, and I choose FormattedText BackgroundColor="gainsbor" ... the same color but with the last letter deleted which turns it lime green. When I'm happy with the size, then I add the add the trailing "o" back in.

In each case in the pic below, the <String> is the same as your example and the L:Var always=55.7. If I use !d! format, then all results will be 56

If Text is used rather than FormattedText, its the same issue. X=" " must be wide enough and BackgroundColor can check it.

View attachment 23642

I ended up with d. I'm still working on the P7 calculation a bit so that at the correct TLA(throttle lever angle) the placarded thrust is shown on the n2 gauges. I need to take half a point off otherwise on hot days advancing the throttle too far could go well into the engine limitations. That said if P7 is not reached at the correct throttle angle then full throttle is allowed. So it's dependent on the ambient pressure. The P7 gauges are scaled in inches.
speeds.jpg
 
Back
Top