Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

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.

Featured Replies

I’m trying to make a recursive function that counts to 10 and stops.  Right now it just keeps counting.  What am I doing wrong?

 

MyCounter ( Number):

Let ( [
    $i = $i + 1
    ];
    Case ( $i < 10 ; MyCounter ( $i ) ; $i )
)

 

I am not sure what you mean by "keeps counting".  I am pretty sure you need to reset $I to 0 or empty at the end of the function, otherwise the next call will start from 10 (and then from 11, 12, etc. - until you close the file).

I would also suggest you avoid using $variables or $$variables in a custom function if possible - and it's certainly possible here. You have  a parameter that you're not using at all. Call the function with a parameter of 10 and count down until it's depleted. Or call it with a parameter of 0 (or empty) and count up until it reaches 10.

 

 

Edited by comment

Hello

 

Maybe it's because you aren't accessing the parameter at all? Try...

 

MyCounter ( Number):

Let ( [
    $i = Number + 1
    ];
    Case ( $i < 10 ; MyCounter ( $i ) ; $i )
)

 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

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.