f



Looking for Custom Function Similar to Howard's "Title" and David's "SmarterProper"

Hi, gang -

I'm looking for a custom function that would capitalize names and
addresses similar to Howard Schlossberg "Title" and David Tremmel's
"SmarterProper," both of which are listed on Brian Dunning's cf site.
The difference is that instead of having a parameter that specifies a
"prefix" list indicating where a capital letter should always be
inserted in a word (such as after the prefixes "Mc" or "Mac"), I'd
like a parameter that specifies exception words that should always be
capitalized as provided in an exceptions list.  For example, if a
person spells their name "LiSa" (kids these days!), I would enter that
name in the exceptions list and the cf would leave it alone if it
encounters that way or correct it to "Lisa" if it encounters it as
"lisa".

I've studied Howard and David's custom functions to attempt this on my
own, but for the life of me I can't master recursion.  I've looked at
all the tutorials and attempted it a dozen times -- we're talking two
years of repeated attempts here -- but I just can't get it.  I don't
know why.  I swear, I can design a database that holds back the tides,
but if it requires a recursive cf, I'm licked.  So anyone know of --
or have; or can give directions to -- a custom function like the one
I'm looking for?

Thanks in advance for any help.

Best,
-J.
0
jahnbigbooty (106)
9/11/2009 5:20:42 PM
comp.databases.filemaker 11053 articles. 0 followers. amosw01 (46) is leader. Post Follow

2 Replies
776 Views

Similar Articles

[PageSpeed] 13

jahn wrote:
> Hi, gang -
> 
> I'm looking for a custom function that would capitalize names and
> addresses similar to Howard Schlossberg "Title" and David Tremmel's
> "SmarterProper," both of which are listed on Brian Dunning's cf site.
> The difference is that instead of having a parameter that specifies a
> "prefix" list indicating where a capital letter should always be
> inserted in a word (such as after the prefixes "Mc" or "Mac"), I'd
> like a parameter that specifies exception words that should always be
> capitalized as provided in an exceptions list.  For example, if a
> person spells their name "LiSa" (kids these days!), I would enter that
> name in the exceptions list and the cf would leave it alone if it
> encounters that way or correct it to "Lisa" if it encounters it as
> "lisa".
> 
> I've studied Howard and David's custom functions to attempt this on my
> own, but for the life of me I can't master recursion.  I've looked at
> all the tutorials and attempted it a dozen times -- we're talking two
> years of repeated attempts here -- but I just can't get it.  I don't
> know why.  I swear, I can design a database that holds back the tides,
> but if it requires a recursive cf, I'm licked.  So anyone know of --
> or have; or can give directions to -- a custom function like the one
> I'm looking for?


You are asking for a situation I didn't necessarily think about (I don't 
think) when I wrote my function, but in a quick test of "lisa" and 
"LiSa" both turn out as dersired when "LiSa" is added to the function as 
one of the prefixes.

Howard

0
howard4272 (336)
9/11/2009 9:06:05 PM
Hi, Howard -

First I should say thanks so much for sharing your brilliant work on
the cf!  It's very well thought out and thoroughly documented.

Thanks also for your response to my post.  I should have tried the
example I gave (LiSa) before posting about it!  But still I think it's
necessary to be able to include an exceptions list.  The cf may work
in this particular case, but I don't think it will in all cases that a
user could come up with.  In fact, what I specifically need is to
replace the prefix rule with an exception list; as you note in your
comments on Brian's site, the prefix "Mac" will work for MacDonald,
but it'll mess up machine, macadamia, macroscopic, etc.  So rather
than try to come up with a rule-based function (always capitalize
after "Mc" etc.), I just want to offer users a way to specify
particular exceptions.  This is less powerful, but it gives them more
control, which is a trade-off I'm willing to make for this particular
database.

In that respect I'm struggling with two problems:  The first is to
change the prefix rule to an exception rule.  The second is to add a
fixList parameter in the cf, rather than as a Let statement variable
in the body of the calculation.  The variable is excellent for
developers, but leaves users with no way to change it.  I've designed
a capitalization dialog that looks like the dictionary dialog so users
can add or delete words in an Exceptions table.  But when I add a
fixList parameter to the cf (one that can be made to point to the
table when defining a field with the cf), the cf returns a blank
result.  Obviously my recursion-challenged skills are at fault here.

I'm continuing to plug away at it, but please don't let that stop
anybody from suggesting some solutions!

Thanks again.

Best,
-Jahn
0
jahnbigbooty (106)
9/12/2009 3:39:38 PM
Reply: