• 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.

Formatted Text - Readout moves across horizontally

Messages
542
Country
australia
I have a small instrument that successfully generates all the text readouts that I require.

In this Element section,
Code:
   <!-- WING SWEEP Degrees  -->
             <Element>
              <Position X="6" Y="6"/>
              <FormattedText X="75" Y="11" Font="Tahoma" FontSize="10" Tabs="1L,37L" LineSpacing="10" Adjust="Left" Color="#A1A9A6" Bright="Yes">
               <String>
                %SWEEP%
                \t%(75 100 (A:Leading Edge Flaps0 Left Percent,percent) rng)%{if}% 16%\{dplo= }%{end}%
                %(40 48 (A:Leading Edge Flaps0 Left Percent,percent) rng) %{if}% 26%\{dplo= }%{end}%
                %(30 36 (A:Leading Edge Flaps0 Left Percent,percent) rng) %{if}% 38%\{dplo= }%{end}%
                %(20 26 (A:Leading Edge Flaps0 Left Percent,percent) rng) %{if}% 47%\{dplo= }%{end}%
                %(10 16 (A:Leading Edge Flaps0 Left Percent,percent) rng) %{if}% 58%\{dplo= }%{end}%
                %(0 5 (A:Leading Edge Flaps0 Left Percent,percent) rng) %{if}% 72.5%\{dplo= }%{end}%
               </String>
              </FormattedText>
            </Element>
Each line results in either of the following;
16 , 26 , 38 , 47 , 58 , 72.5 degrees.
As can be seen this is placed at Tabs=37L .

The 16 degrees reads at the correct position , but as it is cycled by the successive A:Var values the following readouts each progressively move to the right.

My guess is that each line is processing an 'if' or 'else' , and that the 'else is a blank space ,
thus the next line 'if' readout is moved over to the right of that blank space.

How do I correct that issue ?

Cheers
Karol
PS;
Full instrument code is,
Code:
 <Gauge Name="WING SWEEP FLAP READOUT" Version="1.0">
<Size X="82" Y="60" />
<!--Inst BACKGROUND No Bitmaps  Alphasim Virtavia F-111 @Apr2015 -->
    <Element Name="WING RECTANGLE">
        <Position X="0" Y="0"/>
        <Rectangle Width="82" Height="60" FillColor="#272727" Bright="Yes"/>        
    </Element>
   <!-- WING SWEEP Degrees  -->
             <Element>
              <Position X="6" Y="6"/>
              <FormattedText X="75" Y="11" Font="Tahoma" FontSize="10" Tabs="1L,37L" LineSpacing="10" Adjust="Left" Color="#A1A9A6" Bright="Yes">
               <String>
                %SWEEP%
                \t%(75 100 (A:Leading Edge Flaps0 Left Percent,percent) rng)%{if}% 16%\{dplo= }%{end}%
                %(40 48 (A:Leading Edge Flaps0 Left Percent,percent) rng)%{if}% 26%\{dplo= }%{end}%
                %(30 36 (A:Leading Edge Flaps0 Left Percent,percent) rng)%{if}% 38%\{dplo= }%{end}%
                %(20 26 (A:Leading Edge Flaps0 Left Percent,percent) rng)%{if}% 47%\{dplo= }%{end}%
                %(10 16 (A:Leading Edge Flaps0 Left Percent,percent) rng)%{if}% 58%\{dplo= }%{end}%
                %(0 5 (A:Leading Edge Flaps0 Left Percent,percent) rng)%{if}% 72.5%\{dplo= }%{end}%
               </String>
              </FormattedText>
            </Element>            
  <!-- FLAPS EXTENTION Degrees  -->
              <Element>
              <Position X="6" Y="22"/>
              <FormattedText X="70" Y="11" Font="Tahoma" FontSize="10" Tabs="1L,37L" LineSpacing="10" Adjust="Left" Color="#A1A9A6" Bright="Yes">
             <String>
                %FLAPS%
                \t%(0 77 (A:Trailing Edge Flaps0 Left Percent,percent) rng)%{if}% UP%{end}%
                %(80 90 (A:Trailing Edge Flaps0 Left Percent,percent) rng)%{if}% 25%\{dplo= }%{end}%
                %(95 100 (A:Trailing Edge Flaps0 Left Percent,percent) rng)%{if}% 34%\{dplo= }%{end}%            
            </String>
              </FormattedText>
            </Element>
      <!-- SLATS EXTENTION  -->
              <Element>
              <Position X="6" Y="38"/>
              <FormattedText X="70" Y="11" Font="Tahoma" FontSize="10" Tabs="1L,37L" LineSpacing="10" Adjust="Left" Color="#A1A9A6" Bright="Yes">
             <String>
                %SLATS%
                \t%((A:Trailing Edge Flaps0 Left Percent,percent) 0 == if{ ' UP' } els{ ' DWN' } )%!s!%{end}%
            </String>
              </FormattedText>
            </Element>

</Gauge>

EDIT: Corrected above code by removing the spaces.
 
Last edited:
Just remove spaces in front of %{if}'s.
Code:
               <String>
                %SWEEP%
                \t%(75 100 (A:Leading Edge Flaps0 Left Percent,percent) rng)%{if}% 16%\{dplo= }%{end}%
                %(40 48 (A:Leading Edge Flaps0 Left Percent,percent) rng)%{if}% 26%\{dplo= }%{end}%
                %(30 36 (A:Leading Edge Flaps0 Left Percent,percent) rng)%{if}% 38%\{dplo= }%{end}%
                %(20 26 (A:Leading Edge Flaps0 Left Percent,percent) rng)%{if}% 47%\{dplo= }%{end}%
                %(10 16 (A:Leading Edge Flaps0 Left Percent,percent) rng)%{if}% 58%\{dplo= }%{end}%
                %(0 5 (A:Leading Edge Flaps0 Left Percent,percent) rng)%{if}% 72.5%\{dplo= }%{end}%
               </String>
 
Luka

Thank you , that fixed the issue , it now works superbly.
I didn't even notice those spaces , again thank you.

Cheers
Karol
 
Back
Top