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

Enum Pages; Limit?

Messages
10,163
Country
us-arizona
Hey all,

I have created a owners manual for a plane. Its a popup gauge. It has nearly 40 pages in it.

I just discovered in FSX that its skipping. The odd part is that it goes like 1, 5, 10, 8, etc.... Its really odd. The higher numbers are fine. Only the lower numbers.

Is there something I should know about Enum when going over 10 pages? Does FSX not handle Enums correctly?

Here are some sample Elements in the stack. I went through the stack and pages and everything is in order, so for them to not open in order is really odd..


Starting out order of the pages;

Code:
	<Element>
		<Visible>(L:List_Cascade,enum) 0 ==</Visible>
		<Position X="0" Y="0"/>
			<Image Name="Manual_Cover.bmp"/>
	</Element>
	<Element>
		<Visible>(L:List_Cascade,enum) 1 ==</Visible>
		<Position X="0" Y="0"/>
			<Image Name="Manual_Page_Op.bmp"/>
	</Element>
	<Element>
		<Visible>(L:List_Cascade,enum) 2 ==</Visible>
		<Position X="0" Y="0"/>
			<Image Name="Manual_Page1B.bmp"/>
	</Element>
	<Element>
		<Visible>(L:List_Cascade,enum) 3 ==</Visible>
		<Position X="0" Y="0"/>
			<Image Name="Manual_Page2.bmp"/>
	</Element>
	<Element>
		<Visible>(L:List_Cascade,enum) 4 ==</Visible>
		<Position X="0" Y="0"/>
			<Image Name="Manual_Page3.bmp"/>
	</Element>


Last few pages;

Code:
	<Element>
		<Visible>(L:List_Cascade,enum) 36 ==</Visible>
		<Position X="0" Y="0"/>
			<Image Name="Manual_Page35.bmp"/>
	</Element>


	<Element>
		<Visible>(L:List_Cascade,enum) 37 ==</Visible>
		<Position X="0" Y="0"/>
			<Image Name="Manual_PageTeam.bmp"/>
	</Element>



Mouse Click Zones;


Code:
  <Area Left="920" Top="1" Width="80" Height="499">
     <Cursor Type="Hand"/>
     <Tooltip>Turn Forward</Tooltip>
      <Click>
        (L:List_Cascade,enum) 38  &lt; 
            if{ 
                 (L:List_Cascade,enum) 1 +  (>L:List_Cascade,enum)  
              }
              1 (&gt;L:XMLSND132,enum)
      </Click>
   </Area>


  <Area Left="1" Top="1" Width="80" Height="499">
     <Cursor Type="Hand"/>
     <Tooltip>Turn Back</Tooltip>
      <Click>
        (L:List_Cascade,enum) 0  &gt; 
            if{ 
                 (L:List_Cascade,enum) 1 -  (>L:List_Cascade,enum)   
              }
              1 (&gt;L:XMLSND132,enum)
      </Click>
   </Area>


Any thoughts or input would be welcome.


Bill
 
Try:

(L:List_Cascade,enum) ++ int (>L:List_Cascade,enum)

and

(L:List_Cascade,enum) -- int (>L:List_Cascade,enum)

The int should enforce an integer get's placed into your (L:var,enum)
 
Last edited:
Thanks Bill.

Really wierd. Maybe it has a limit? My thoughts were that it was having issues with placement of 1 and 10, 2 and 20, 3 and 30, etc.. In Panel configs, its 00, 01, thru to 10, 20, 30... I think that might be what is tripping it.


I'll try this and let you know how it works out.



Bill
 
This didnt work. arrrgh..


Is it possible to go with letters instead of numbers? That still would only give me 24 pages and I need 40+. I intend to add to the manual.

Another obstacle...



Bill
 
I tried enum with 01, 02, 03..... and with -- int ++ int, it worked but was still out of order.

I tried this with 1+ and 1 - and again, it didnt work.

I tried tuning it with 01 instead of 1 in the mouserect section and that too didnt work.

The first above did boot up the gauge, but the second two would not allow the gauge to run.


<rubs eyebrows... talking to them about code...>
 
This is weird. It certainly looks alright. In fact I did something like that a couple of months back, too.
I used a G: variable for this:

Code:
(G:Var1) 1 + (&gt;G:Var1)
(G:Var1) 5 &gt;
if{
  0 (&gt;G:Var1)
}
 
Hi,
so in the higher page numbers it does work?
If so, then what if you start your List_Cascade,enum count at a higher number?

So give it a value of say 10 at gauge initialization and count from there.
You need to build in a facility to prevent setting the value to 10 at each gauge cycle, something like this:

Code:
(L:initialize, enum) 0 == if{ 10 (&gt;L:List_Cascade,enum) 1 (&gt;L:initialize, enum) }

Strange things happening here...

grt
Willem.
 
Ok.. I am going to come clean and repent..

I made a mistake..

Yesterday, going through the textures (Bitmaps) of this manual, I found some mistakes in the group 1 thru 10... and a couple of others (out of 40). Fixed the graphics mishaps (page numbers on them, and misplaced versions) and now all is working wonderfully, like a well oiled machine...

I guess too many hours at the computer can have side effects when not taking breaks..



Bill
 
I guess too many hours at the computer can have side effects when not taking breaks..

Whew! I'm happy you found the boo-boo.

Not to worry though. Care to guess how long it took me to spot the error here? :(

Code:
<String>%(((L:T38_AoA,enum))%!2.2f!%</String>
 
Well, all of a blink of an eye ??? :D

No, seriously, finding this kind of small but oh so important-to-get-right mistakes can of course take way longer than one would suspect.
Especially when working late at night after a long session of coding or drinking beers and thinking that you just found the solution to end all xml problems once and for all...:stirthepo

Been there, done that ... :banghead:

grt
Willem
 
Care to guess how long it took me to spot the error here? :(

Code:
<String>%(((L:T38_AoA,enum))%!2.2f!%</String>

XML spells like that are what put would-be programmers off programming :confused: but I'd hazard a guess you're missing a right parenthesis? Or have one left parenthesis too many...
 
XML spells like that are what put would-be programmers off programming :confused: but I'd hazard a guess you're missing a right parenthesis? Or have one left parenthesis too many...

One too many left parenthesis...

As a matter of fact, the silly requirement that all variables need a DOUBLE set of parenthesis is another point of frequent failure also! :censored:
 
Back
Top