December 13, 200718 yr 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.
December 14, 200718 yr Moderator 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
December 16, 200718 yr 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}
December 16, 200718 yr Hi,Try%((@c:FacilityCity) uc)%!s!Hope it helps,Jan"Beatus ille qui procul negotiis..." Jan "Beatus ille qui procul negotiis..."
December 16, 200718 yr That's the ticket, thanks Jan!Any idea why FacilityRegion doesn't show anything?
Create an account or sign in to comment