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.

<m:event> question ....kind of

Featured Replies

(L:groupn,enum) 0 == (* COULD HAVE BOOLED IT BUT THERE ARE 1-20 so i left it in for an easier read *) (M:Event) 'Leave' scmp 0 == if{ 0 (>L:BASE1, enum) 1 (>L:nrdw, enum) }(M:Event) 'LeftSingle' scmp 0 == if{ 1 (>L:BASE1, enum) 1 (>L:vclick1,enum) (L:IN_UT,bool) if{ (L:latitude,enum) (>L:ins1_lat,enum) (L:longitude,enum) (>L:ins1_lon,enum) } (L:IN_UT,bool) ! if{ (L:navmas,bool) if { (L:ins1_lat,enum) (>L:waypoint_lat,enum) (L:ins1_lon,enum) (>L:waypoint_lon,enum) } (L:navmas,bool) ! if{ 185(>K:VOR1_SET) 113.20 @radioconvert(>K:NAV2_RADIO_SET)108.10@radioconvert(>K:NAV1_RADIO_SET)405.0 @adfconvert } } since the resident gurus of the moment seem to be 'tom' and 'jan' this question is for them, as part of an ongoing set of posts.re;INS system can i get away with the long 'if'y m:event above? man is it long and ugly! i have noticed alot of code is sloppy about closeing all the '{' that are opened and for the most part with out any ill effects. if the hierachy of '{' & '}' is not crucial then the code above is doomed. in addition to the device that dials in the lat/lon (previous posts)the nav computer has a panel with 10 buttons. ( there is a high and low range which means 20 button functionality) say button 1 is pushed; then if the (L:in_out,bool)switch is '1' the dialed lat/lon are stored as wpt1.if (L:in_out,bool) is '0' then pressing the #1 button will send the wpt1 data to the GPSdll as the active waypoint, or place a pre-set bunch of data into the nav radios and adf. this depends on (L:navmas,enum) another switch determining mode.( INS vs RADIO NAV ) this code is repeated 20 times, to avoid repeating it 60 times i need to nest the conditions, or nest a buch of statements i have never seen an inside of a mouse event so the nested ifs or visibles seem my only optionyour thoughts ?

  • Author

Hi Ridgell,>>re;INS system >can i get away with the long 'if'y m:event above? man is it>long and ugly! i have noticed alot of code is sloppy about>closeing all the '{' that are opened and for the most part>with out any ill effects. if the hierachy of '{' & '}' is not>crucial then the code above is doomed. Many times if{ els{ syntax can be avoided by using "bool maths"; I cannot say this is one of those cases though. You can search the forum for a bunch of posted examples.>>this code is repeated 20 times, to avoid repeating it 60 times>i need to nest the conditions, or nest a buch of >statements >If I was you, I would try to code a set of macros to deal with repetitive code :-)>i have never seen an inside of a mouse event so the>nested ifs or visibles seem my only option>There is no chance to insert an inside a section...>>your thoughts ?>Just posted :-)Saludos,Tom

Hi,Cannot test it, but may be a little bit more efficient:(M:Event) 'Leave' scmp 0 == if{ 0 (>L:BASE1, enum) 1 (>L:nrdw, enum) } (M:Event) 'LeftSingle' scmp 0 == if{ 1 (>L:BASE1, enum) 1 (>L:vclick1,enum) (L:IN_UT,bool) if{ (L:latitude,enum) (>L:ins1_lat,enum) (L:longitude,enum) (>L:ins1_lon,enum) } els{ (L:navmas,bool) if{ (L:ins1_lat,enum) (>L:waypoint_lat,enum) (L:ins1_lon,enum) (>L:waypoint_lon,enum) } els{ 185 (>K:VOR1_SET) 113.20 @radioconvert (>K:NAV2_RADIO_SET) 108.10 @radioconvert (>K:NAV1_RADIO_SET) 405.0 @adfconvert (>K:ADF_SET) (?) } } } Jan"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

d 10 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + r 1000 < if{ (>K:ADF_LOWRANGE_SET) } els{ (>K:ADF_HIGHRANGE_SET) }} it was in there! just had the > in the macro. cut and pasted from arne's post. thanks jan, ill give it a look see, it is certainly neater.

jan, can i use an 'els' statement ?it will not trap non qualifiers of the (M:Event) 'Leave' scmp 0 == if{....} or does the 'els' only grab from the preceeding if{} ?I never have been real clear on that.

while i still would like answer to the 'els' if that answer is no, then i think it might be time to go to a plain and seek a different button animation! the reason for the scamp= m-event.

  • Author

Ridgell, els{ } will execute as long as the last stack's value is 0. No need to have an if{ preceeding, but no really useful without it...For example:els{ 1 2 + } will return 3 Tom

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.