Welcome to TechNet Blogs Sign in | Join | Help
Don't let this happen to you

Continuing on the theme of displaying text in an XML gauge, I just spent more time than I would like to admit trying to figure out why this script wasn't working for me:

%( (A:ATC ID) )%!s!

The problem, of course (which I only resolved by stepping into the depths of the stack-calculator code), was that I was missing the UNITS for this simvar.  Yes, "ATC ID", which is a string, requires UNITS.  UNITS!  Argh.  So I changed it to this:

%( (A:ATC ID, string) )%!s!

and I was on my merry way.

So learn from my stupid mistakes!  Don't do this!  Don't forget that all "A:" variables require units! See my post on "An alphabet worth of variables" for which types require units.  And I just added an assert (which we can hopefully upgrade to some kind of error message that end users can see) so that I at least won't suffer from my own stupidity in this arena again.

Posted: Thursday, November 17, 2005 8:23 PM by EnGauged

Comments

Doug Dawson said:

How much single malt scotch would I have to offer up in order to convince someone to do the coding required so that a default value for units would be assumed? If this were feasible, it would probably make debugging xml gauges a little easier. There would be one less thing that could cause your gauge, or part thereof, to simply not appear on the panel.
Cheers,

Doug Dawson
# November 17, 2005 6:52 PM

EnGauged said:

That's a great question, but I think you're going about it all wrong. I don't really like scotch so much. I go more for the sweet stuff - how about some dark chocolate? I agree with your point about the units, though... it's not an unreasonable request and I will have to investigate how much work it would require. Thanks for the suggestion.
# November 17, 2005 10:08 PM

Tom Gibson said:

Hi,

The only problem with allowing default units is that if a gauge builder assumed different units the gauge would "work", but not "work right". Somewhat subtle and harder to debug than it not showing up at all.

And the default units would have to be clearly stated in the SDK. :)

Take care,
# November 21, 2005 2:33 PM

n4gix said:

I share your pain! Actually, I think making the requirement for units *absolute* would be a good move... As it stands now, the "sometimes you need 'em, sometimes you don't" is rather confusing and counterintuitive... ;)
# November 22, 2005 10:28 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker