Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XML Array member value shift

Featured Replies

xml FS9Hi all I have an array with 20 members and would like to delete the values from say members 3 to 6 and have the following values all move up is this possible and how?

Paul EGLD

  • Moderator
xml FS9Hi all I have an array with 20 members and would like to delete the values from say members 3 to 6 and have the following values all move up is this possible and how?
If you are talking about an ordered list of items (such as a EICAS list of "warnings," or similar, the solution is to use <FormattedText> in a <String>Here's an example of a "scrolling EICAS Message list." This list will only appear if there is a "warning condition" detected, and each "message" will appear in the list in order from the top down. It even features several choices of color for each condition... 8-)It makes extensive use of @Macros to keep the "code" compact and readable:
		<!-- XXXXXXXXXXXXXXXXXXXXXXXXX EICAS MESSAGES XXXXXXXXXXXXXXXXXXXXXXXXXX -->		<Macro Name="WarningCondition">			@OilPressure_Eng1_Warning			@OilPressure_Eng2_Warning or			@GenFail_Eng1_Caution or			@GenFail_Eng2_Caution or			@Battery1LowVolt or			@Battery2LowVolt or			@PitotHeat or			@DoorOpen or			@Gear_Warning or		</Macro>		<Macro Name="OilPressure_Eng1_Warning">			(A:Eng1 Oil Pressure, PSF) 12 <		</Macro>				<Macro Name="OilPressure_Eng2_Warning">			(A:Eng2 Oil Pressure, PSF) 12 <		</Macro>				<Macro Name="GenFail_Eng1_Caution">			(A:General Eng Generator Active:1,bool) 0 ==		</Macro>				<Macro Name="GenFail_Eng2_Caution">			(A:General Eng Generator Active:2,bool) 0 ==		</Macro>		<Macro Name="Battery1LowVolt">			(A:ELECTRICAL GENALT BUS VOLTAGE:1,volts) 10 <		</Macro>		<Macro Name="Battery2LowVolt">			(A:ELECTRICAL GENALT BUS VOLTAGE:2,volts) 10 <		</Macro>						<Macro Name="DoorOpen">			(A:Exit Open:0,bool) (A:Exit Open:1,bool) or (A:Sim On Ground,bool) and		</Macro>		<Macro Name="PitotHeat">			(A:PITOT HEAT,bool) !		</Macro>		<Macro Name="Gear_Warning">			(A:Gear Warning, bool)		</Macro>		<Element Name="ALERT MESSAGE WINDOW RECTANGLE">			<Visible>@WarningCondition</Visible>			<Position X="736" Y="282"/>			<Rectangle Width="127" Height="183" LineWidth="1" Color="White" FillColor="Black" Bright="Yes"/>		</Element>		<Element>			<Position X="740" Y="284"/>			<FormattedText X="182" Y="210" Font="Arial Bold" FontSize="16" Adjust="Left" Color="#DE243B" VerticalAdjust="Center" Bright="Yes">				<Color Value="#FFFF00"/>				<String>					%(@DoorOpen) %{if}DOOR OPEN\n%{end}					\{clr2}					%(@PitotHeat)%{if}PITOT OFF\n%{end}					\{clr1}					%(@OilPressure_Eng1_Warning)%{if}L OIL PRES\n%{end}					%(@OilPressure_Eng2_Warning)%{if}R OIL PRES\n%{end}					\{clr2}					%(@GenFail_Eng1_Caution)%{if}L ALTN FAIL\n%{end}					%(@GenFail_Eng2_Caution)%{if}R ALTN FAIL\n%{end}					%(@Battery1LowVolt)%{if}L VOLTS LOW\n%{end}					%(@Battery2LowVolt)%{if}R VOLTS LOW\n%{end}					%(@PitotHeat)%{if}STALL HT OFF\n%{end}\{clr1}					%(@Gear_Warning)%{if}GEAR\n%{end}				</String>			</FormattedText>		</Element>

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author
If you are talking about an ordered list of items (such as a EICAS list of "warnings," or similar, the solution is to use <FormattedText> in a <String>Here's an example of a "scrolling EICAS Message list." This list will only appear if there is a "warning condition" detected, and each "message" will appear in the list in order from the top down. It even features several choices of color for each condition... 8-)It makes extensive use of @Macros to keep the "code" compact and readable:
		<!-- XXXXXXXXXXXXXXXXXXXXXXXXX EICAS MESSAGES XXXXXXXXXXXXXXXXXXXXXXXXXX -->		<Macro Name="WarningCondition">			@OilPressure_Eng1_Warning			@OilPressure_Eng2_Warning or			@GenFail_Eng1_Caution or			@GenFail_Eng2_Caution or			@Battery1LowVolt or			@Battery2LowVolt or			@PitotHeat or			@DoorOpen or			@Gear_Warning or		</Macro>		<Macro Name="OilPressure_Eng1_Warning">			(A:Eng1 Oil Pressure, PSF) 12 <		</Macro>				<Macro Name="OilPressure_Eng2_Warning">			(A:Eng2 Oil Pressure, PSF) 12 <		</Macro>				<Macro Name="GenFail_Eng1_Caution">			(A:General Eng Generator Active:1,bool) 0 ==		</Macro>				<Macro Name="GenFail_Eng2_Caution">			(A:General Eng Generator Active:2,bool) 0 ==		</Macro>		<Macro Name="Battery1LowVolt">			(A:ELECTRICAL GENALT BUS VOLTAGE:1,volts) 10 <		</Macro>		<Macro Name="Battery2LowVolt">			(A:ELECTRICAL GENALT BUS VOLTAGE:2,volts) 10 <		</Macro>						<Macro Name="DoorOpen">			(A:Exit Open:0,bool) (A:Exit Open:1,bool) or (A:Sim On Ground,bool) and		</Macro>		<Macro Name="PitotHeat">			(A:PITOT HEAT,bool) !		</Macro>		<Macro Name="Gear_Warning">			(A:Gear Warning, bool)		</Macro>		<Element Name="ALERT MESSAGE WINDOW RECTANGLE">			<Visible>@WarningCondition</Visible>			<Position X="736" Y="282"/>			<Rectangle Width="127" Height="183" LineWidth="1" Color="White" FillColor="Black" Bright="Yes"/>		</Element>		<Element>			<Position X="740" Y="284"/>			<FormattedText X="182" Y="210" Font="Arial Bold" FontSize="16" Adjust="Left" Color="#DE243B" VerticalAdjust="Center" Bright="Yes">				<Color Value="#FFFF00"/>				<String>					%(@DoorOpen) %{if}DOOR OPEN\n%{end}					\{clr2}					%(@PitotHeat)%{if}PITOT OFF\n%{end}					\{clr1}					%(@OilPressure_Eng1_Warning)%{if}L OIL PRES\n%{end}					%(@OilPressure_Eng2_Warning)%{if}R OIL PRES\n%{end}					\{clr2}					%(@GenFail_Eng1_Caution)%{if}L ALTN FAIL\n%{end}					%(@GenFail_Eng2_Caution)%{if}R ALTN FAIL\n%{end}					%(@Battery1LowVolt)%{if}L VOLTS LOW\n%{end}					%(@Battery2LowVolt)%{if}R VOLTS LOW\n%{end}					%(@PitotHeat)%{if}STALL HT OFF\n%{end}\{clr1}					%(@Gear_Warning)%{if}GEAR\n%{end}				</String>			</FormattedText>		</Element>

Ahh!! Yes, It could be done that way. I'll give it a tryThanks

Paul EGLD

  • Moderator

Here is the meat of the technique... Consider the following which 'prints' one line of the list:%(@PitotHeat)%{if}PITOT OFF\n%{end}Note that every line begins with the % character. This is a flag saying "evaluate what follows this flag."Note that the \n (carriage return or new line) is bundled with the "true" condition of the if{ } structure. This way, if the condition is "false" no carriage return/new line occurs...Lastly, the %{end} closes out the initial % (evaluate) sequence. :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.