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.

Conditioned Printing

Featured Replies

Hi,%((A:INDICATED ALTITUDE,feet)(L:Var,feet) < )%{if} ALTITUDE %{end} This works but ....%((A:PLANE LATITUDE,feet)(L:Var,feet) < )%{if} (A:INDICATED ALTITUDE,feet) %{end} does not work! So printing the word "ALTITUDE" works alright but printing a Variable does not.Am I doing something wrong or is there a work around?Thanks for your timeRoerlof

Hi,Try to add: %!d!%((A:PLANE ALTITUDE,feet)(L:Var,feet) <)%{if}%((A:INDICATED ALTITUDE,feet))%!d!%{end}Jan"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Commercial Member

You need to 'printf' the variable. With literal strings like 'ALTITUDE' you just type the characters and they appear:%ALTITUDEWith numeric variables, you need to define the format that they're to 'print' with:%((A:INDICATED ALTITUDE,feet))%!d!%!d! will print an integer.!6.3f! will print 2 places in front of the decimal and 3 behind. The first value (before the decimal) is the total number of places (integer + the decimal point itself + the decimals. The second value is the number of decimals. Confusing you yet?For example if your altitude is 36089.535 feet and you want to ignore the decimal feet, you'd use %((A:INDICATED ALTITUDE,feet))%!d!% the result will be '36089'If you wanted to print 2 positions after the decimal you'd use:%((A:INDICATED ALTITUDE,feet))%!8.2f!%The result would be 36089.53So your code would look like this (assuming you want to ignore the decimals).%((A:PLANE LATITUDE,feet) (L:Var,feet) <)%{if}%((A:INDICATED ALTITUDE,feet))%!d!%{end}--Jon

Thank you gentlemem. It was just a matter of syntax. I thought I had it covered {if}%((A:INDICATED ALTITUDE,feet))%!3d!%{end}but had forgotten the last % and never saw it.Thanx againRoelof

Thanks Jon.:) Now could you explain the letter variables?I've been more or shooting in the dark since the SDK doesn't explain these values although I know what works in certain circumstances. You used both 'd' and 'f' in the above example. I knew 'd' displayed an integer but I thought 'f' was a frequency tag. I've also seen an 's' although the one time I saw it while perusing some code it was used with an actual text entry.Rgds: Jeff

Jeff'f' is for floating point's' for string'd' for integerLeading Zeros and spaces between digits.For zeros. 0 and de length of the number to display in front of d or f determens the number of leading zeros. Remember the period also counts in the length%Local QNH %((A:BAROMETER PRESSURE,millibar))%!4.2f!Will Show: QNH 1013.25 %MagnHeadRwy1 %((L:RALS RWMagHead1, degrees))%!03d!Will Show: 006 if degrees is 6%MagnHeadRwy2 %((L:RALS RWMagHead2, degrees) 100 / int)%!d!% %((L:RALS RWMagHead2, degrees) 100 % 10 /)%!d!% %((L:RALS RWMagHead2, degrees) 10 %)%!d! Will Show: 1 9 6 if degrees is 196 %MagnHeadRwy2 %((L:RALS RWMagHead2, degrees) 100 / int)%!01d!% %((L:RALS RWMagHead2, degrees) 100 % 10 /)%!01d!% %((L:RALS RWMagHead2, degrees) 10 %)%!01d!Will Show 0 0 6 if degrees is 6%!003d!° Will show the degree symbol as wellHope this tells you what you want to konwRoelof>Thanks Jon.>:) Now could you explain the letter variables?>I've been more or shooting in the dark since the SDK doesn't>explain these values although I know what works in certain>circumstances. You used both 'd' and 'f' in the above example.>I knew 'd' displayed an integer but I thought 'f' was a>frequency tag. I've also seen an 's' although the one time I>saw it while perusing some code it was used with an actual>text entry.>>Rgds: Jeff

Thanks Roelof.That cleared up a few misconceptions I had!Always useful to know 'when' something works, but even more useful to know 'why' it works.Merry Christmas.Rgds: Jeff

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.