Sign in to follow this  
WarpD

Getting station name

Recommended Posts

Ok, I'm a bit stumped.This code:if (HSI_STATION_NAMEvar.var_value.p) { strcpy(hsi_station_name,HSI_STATION_NAMEvar.var_value.p); }...crashes.Any "C" gauges gurus have a suggestion or know what I'm doing wrong?

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

What variable type is "hsi_station_name"?Long time ago, but I used sprintf(pelement->string,"%s",HSI_STATION_NAMEvar.var_value.d); the last time I printed IDs to ELEMENT_STRINGsArne Bartels

Share this post


Link to post
Share on other sites

hsi_station_name is:char hsi_station_name;Why did you use var_value.d?? Isn't that d representing BCD?

Share this post


Link to post
Share on other sites

At least char hsi_station_name[5]="";four digits+trailing zero. A char is only one char and the average ID is longer then one char. ...var_value.d or ...var_value.p doesn't make much difference, both works, but .p might be more logical. Actually all var_value.... behave the same with the exception of var_value.n.Arne Bartels

Share this post


Link to post
Share on other sites

Yep... thanks Arne... thought my feeble mind had missed something. ;)I don't do a whole lot of C programming, almost all my work is in the Delphi area... so I tend to 'forget' how to use C from time to time. LOL

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this