Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

String for Radio Height

Featured Replies

%((P:Units of measure, enum) 2 == if{ (A:Radio height, meters) } els{ (A:Radio height, feet) } d 4500 <= )%{if}%(1 /)%!04d!0%{end}Hi!Look at the string above. It's to show the alt above the ground on an EADI. I've took the source code for this string from an other gauge and just edited the string a bit. This was long time ago. At this time I thought not even looking at the string-code would be the best!!! Since then, I (nearly)never had to work with strings again.But there always was one little problem(and one question), which I thought is not that important. It really isn't, but I want to know it:1.)Why is (P:Units of measure, enum) used here. Isn't this the sim-rate??? What does this do in the code?2.) As defined, the string should be int and should have 4 digits. But if there's just "350feet" shown, it shows up 0350. How to cut the "0" away??? Maybe with abs??? I didn't want to try it, because I'm an absolute full at string-codes!Is there anywhere a good discription about strings? Regards,Harry :-)

Hi Harry,About P:Units of measure, enum I think that is connected to which settings you use fs 2002 I had a problem with an altimeter not "showing correct" which was dependant upon international settings settings ie showing meters insted of feet..I am not very good at strings but I think that you can try to remove the zeros in your code. Try %!4d! In the Arne Bartel's xml guide zip file there are some hmtl pages describing printing I thinkhave a look at them...BrgdsEugen

Strange shouldn't it be "10 /" instead of "1 /"?In difference to the SDK there are more than one variable available under the P: prefix, one of them is "Units of measure" to show the unit system you have selected at the moment. 0 for US-System with alts in feet and temperatures in Farenheit, 1 for metric sytem with alt in feet and temps in Celsius and 2 for alts in meters and temperature in Celsius. You find a complete list of P: vars in my p_vars.txt file.The format !04d!0 means, that there is always a trailing zero, that's why I'm asking if it should be divided by ten instead of one.!04d! means for digits and fill up to the left with 0 if necessary, if you don't want leading zeros write !4d!. Arne Bartels

Hi,for example !3.1f! means 3 number in total included the one after the point or 3 before the point and one after?RgdsEugen

Three chars in total, one before the decimal, the decimal point itself and one digit after the decimal. So 1.09123456789 is displayed as "1.1". If the value is too high (>=10) it is often displayed corrrectly with one digit after the decimal point, this seems to depend on the Length parameter.Arne Bartels

I see, I think I understand the logic :-)Eugen

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.