Jump to content
Sign in to follow this  
Guest BFG

Country Display

Recommended Posts

Guest BFG

Hi allI'm wondering if the following would be possible:A gauge that spits out a line of text containing only the country you are currently in, possibly by referencing the first letters of the nearest airport ICAO, or any other more reliable way that you guys may know of. Alternatively, even just the general "region" by referencing the first letter only of an ICAO code.First prize would be the "regions" listed in the "go to airport" selection page in the FS interface.The gauge would probably have to contain a reference list of countries and their ICAO codes, which is no problem, I'm just looking for an example on how to go about this. Any help would be much appreciated.

Share this post


Link to post
Share on other sites

You can obtain the "region code" from the fs9gps.dll if you ask politely... ;)C:fs9gps:WaypointAirportRegionC:fs9gps:WaypointIntersectionRegionC:fs9gps:WaypointNdbRegionC:fs9gps:WaypointVorRegionC:fs9gps:FacilityRegionC:fs9gps:IcaoSearchCurrentIcaoRegionYou can request these from an XML gauge using the G500 example script, or from a C gauge using the "execute_calculator_code(); method.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest BFG

Thanks so much Bill!I'm having some luck with this now. FacilityCity works perfectly, but FacilityRegion doesn't show anything.My code:------------------- C:fs9gpsC:fs9gps (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 1 (>@c:NearestAirportMaximumItems) 200 (>@c:NearestAirportMaximumDistance, NMiles) 0 (>@c:NearestAirportCurrentLine) (@c:NearestAirportCurrentIcao) (>@c:FacilityIcao) %( (@c:NearestAirportItemsNumber, Number) 1 >= )%{if}%((@c:FacilityCity))%!s!%{else}Loading%{end} ---------------------------If I could get it to display FacilityRegion (ie. Country) it would be fantastic.One more question, how do I display the output in upper case? I know this has something to do with {uc} but I'm not sure where to put it in this line:%( (@c:NearestAirportItemsNumber, Number) 1 >= )%{if}%((@c:FacilityCity))%!s!%{else}Loading%{end}

Share this post


Link to post
Share on other sites

Hi,Try%((@c:FacilityCity) uc)%!s!Hope it helps,Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites
Guest BFG

That's the ticket, thanks Jan!Any idea why FacilityRegion doesn't show anything?

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