January 7, 200323 yr %((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 :-)
January 7, 200323 yr 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
January 7, 200323 yr 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
January 8, 200323 yr 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
January 8, 200323 yr 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
Create an account or sign in to comment