June 6, 201114 yr 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.
June 6, 201114 yr 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