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.

Recursive Function Help

Featured Replies

I am looking for someone to coach me through building my first recursive CF.

Scenario...

Text field 1 record 1 contains "refste231"

cf returns "refste" which is everything left of the first number in the string.

Text field 1 record 2 contains "1q2w3e"

cf returns null because left most char in the string is a number.

Text field 1 record 3 contains "r324"

cf returns "r" which is everything left of the first number in the string.

Any thoughts on how to get this to work?

You don't really need a recursive calculation for this:

Let ( [

num = Filter ( text ; "01234567889" ) ;

firstNum = Left ( num ; 1 ) ;

pos = Position ( text ; firstNum ; 1 ; 1 )

] ;

Case ( pos ; Left ( text ; pos - 1 ) ; text )

)

However, if you want to use this as an opportunity to learn about custom functions, then try an algorithm like:

Check if the first character of text is numeric: if false, return the character, and check if text has more characters: if true, call the function again with the rest of the text.

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.