Jump to content

ProperCase Problems....


strido

Recommended Posts

So here's the deal -

 

I'd like to have the recipient's first name be proper case because they always send it in caps. Looks silly. However, when starting a paragraph with this, it presents a problem when the client leaves that field empty:

 

var Var1 = "RecipientFirstName";

return ToTitleCase(Field(Var1)+", the ");

if (Field("RecipientFirstName") == "")

return "The " );

 

I'm trying to do RecipientFirstName in proper case, followed by a comma and the word "the" - using that code above, it will always capitalize the word "the" even if it's not starting the paragraph. I'd like to create a rule that will only capitalize "the" when the Recipient's first name field is empty. Using that rule above, it will capitalize the "The" regardless.

Link to comment
Share on other sites

Oops, I overlooked the fact that your first return executes outside a loop and so the second two lines never get the opportunity to run. Try modifying your code to read:

var Var1 = Field("RecipientFirstName"); 
if (Var1 == "") return "The ";
else return ToTitleCase(Var1) + ", the ";

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...