- Messages
- 67
- Country
I had an idea for a very simple gauge. When flying for my VA, I'd like to have a piece of paper taped to the panel showing the flight number. I did a quick design, and it works pretty well.
Now, I'd like to gussy it up a bit. If there is no flight number, I'd like the paper to say something else (right now, I'm using "Be Safe"). If I'm not flying for an airline, I'd like the whole paper (gauge) to go away.
No problem. I'll just examine the ATC AIRLINE and ATC FLIGHT NUMBER strings and use the <Visible> property.
But it's not working. Apparently, I do not understand what scmp returns. I've only seen it used for MouseEvents, but it should be able to compare any two strings, right? The SDK seems to say that it returns -1 if the strings match. It didn't say what is returned if they don't match -- I guessed zero, but perhaps I'm wrong.
At any rate, I'd appreciate it if you'd take a look at this little XML code, and fix my logic! Right now, the gauge displays correctly if there is an airline defined, and does not appear if there is not. So, right or wrong, my first use of scmp is at least working the way I want. But I thought -1 meant the strings match....
The flight number is vexing me. I either get both strings, or neither to show up. Phooey! I've tried all sorts of random combinations, and finally realized I have no idea what I'm doing!
Thanks!
Now, I'd like to gussy it up a bit. If there is no flight number, I'd like the paper to say something else (right now, I'm using "Be Safe"). If I'm not flying for an airline, I'd like the whole paper (gauge) to go away.
No problem. I'll just examine the ATC AIRLINE and ATC FLIGHT NUMBER strings and use the <Visible> property.
But it's not working. Apparently, I do not understand what scmp returns. I've only seen it used for MouseEvents, but it should be able to compare any two strings, right? The SDK seems to say that it returns -1 if the strings match. It didn't say what is returned if they don't match -- I guessed zero, but perhaps I'm wrong.
At any rate, I'd appreciate it if you'd take a look at this little XML code, and fix my logic! Right now, the gauge displays correctly if there is an airline defined, and does not appear if there is not. So, right or wrong, my first use of scmp is at least working the way I want. But I thought -1 meant the strings match....
The flight number is vexing me. I either get both strings, or neither to show up. Phooey! I've tried all sorts of random combinations, and finally realized I have no idea what I'm doing!
Code:
<Element>
<Visible>(A:ATC AIRLINE, string) "" scmp -1 == </Visible>
<Image Name="NotePaper.bmp" Transparency="0.6"/>
<Element>
<Position X="24" Y="48" />
<Text X="400" Y="70" Length="22" Font="Segoe UI" Color="#2495D7" Adjust="Center">
<String>%((A:ATC AIRLINE,string))%!s!</String>
</Text>
</Element>
<Element>
<Position X="26" Y="120" />
<Rectangle Color ="Black" LineWidth="4" Height="128" Width="400" />
</Element>
<Element>
<Position X="26" Y="120" />
<Visible>(A:ATC FLIGHT NUMBER,string) "" scmp -1 == </Visible>
<Text X="400" Y="160" Length="5" Font="Rage Italic" Color="#000000" Adjust="Center" Fixed="No">
<String>%((A:ATC FLIGHT NUMBER,string))%!s!</String>
</Text>
</Element>
<Element>
<Position X="26" Y="120" />
<Visible>(A:ATC FLIGHT NUMBER,string) "" scmp 0 == </Visible>
<Text X="400" Y="160" Length="7" Font="Rage Italic" Color="#000000" Adjust="Center" Fixed="No">
<String>Be Safe</String>
</Text>
</Element>
</Element>
Thanks!