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.

Just need a little help understanding this CF

Featured Replies

Hi, all:

I'm having a bit of a brain hernia trying to understand how the following, recursive CF--that creates an acronym of an organization's name--works:

-------------

Let ( [

numWords = WordCount (TextString) ;

firstLetter = Upper (Left (TextString ; 1))

];

Case ( numWords > 0 ; firstLetter & Acronym_CFpub ( RightWords (TextString ; numWords - 1)))

)

-------------

I "get" the Let part of the CF and the first part/left side of the Case statement, but it's the recursive part (right side) of the Case statement that's throwing me for a loop. (Okay, that was a lame pun.)

Say the organization's name is Froot Loop Jihad:

When there's more than one word (numWord) does the CF work from "right to left" where, on the first pass, FMP looks at the right side of the calc and says, "Oh, for the TextString ("Froot Loop Jihad") there are three words so I'll take away the right-most one and..." But if it does that, how does it grab its first letter?

...and that's where I get confused. (It's no wonder I failed Geometry because I couldn't figure out how to "proof" shapes.) Any help in 'splainin' the theory here would be great appreciated.

It works from left to right. It takes the first character of TextString, then calls the function again with TextString minus the first word.

See also:

http://fmforums.com/forum/topic/59216-proper-text/page__view__findpost__p__280075

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.