Jump to content
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?


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites
Guest bartels

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?


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites
Guest bartels

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


Ed Wilson

Mindstar Aviation
My Playland - I69

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...