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.

Finding max and min numbers in the stack

Featured Replies

  • Author

WOW, you are the Macro King Tom. Many thanks for the code. I'll run off now and give this a try. Many, many thanks for your help with this.cheers for now,nick

  • Author

Hi Tom, having great fun with this.Now, L:Variables are interactive between different gauges. Is this the same with macros. Can you set up a macro in one gauge, and then use the @macro name in another?I'm going through your code at the moment. You say it filters out those ranges that are zero. I'm attempting to find out how it does this. This will hopefully give me an understanding how I can then filter out aircraft that are more than plus or minus 9900 feet away from my aircraft, that is, their relative altitude to my aircraft is greater than plus or minus 9900 feet. Should keep me off the streets for a while.cheers,nick

""Hi Tom, having great fun with this.""Hey Nick, I plenty understand you cause I HAD great fun coding the stuff!!:-)""Can you set up a macro in onegauge, and then use the @macro name in another?""Unfortunately no. But you can copy and paste the code, and that's a great advantage per se if you see it optimistically.Remember that macros are literal replacement of code; also parameters passed to macros replace their corresponding @n tags literally. ""You say it filters out those ranges that are zero. I'm attempting to find out how it does this.""Well, there is a bit of cheating here. If you take a look at this macro: d 0 == if{ p 9999 }in fact what the code does is assign 9999 to those lvars (or "s" positions) that are zero. All these will be "pushed" to the last positions. It's simpler and faster than other alternatives that I evaluated. What you have to do is, in case you find a "Lvar_nmiles" in a position lower than 08 that reads 9999, just discard it and its related ones. I forgot to mention this, sorry."This will hopefully give me an understanding howI can then filter out aircraft that are more than plus orminus 9900 feet away from my aircraft, that is, theirrelative altitude to my aircraft is greater than plus orminus 9900 feet"Once you understand how the code manages the interaction between stack variables and operators inside the macros, you'll find very easy to create any kind of filtering conditions between the set of variables. Take your time, I guess that's part of the fun :-)Let me know of your progress.Regards,Tom

  • Author

Thank you Tom, you are very helpful. Now back to some headscratching.cheers for now,nick

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.