It's certainly possible to write some logic like this:

  if (numberOfParents > 1)
    return "assure";
  //else
  return "assures";

But how do you determine the number of parents from your data in the
first place?  You could simply look for the presence of the word "and"
in the input data field.  Something like this would be a nice
"JavaScript-y" way to accomplish this, only finding "and" as a whole
word:

  if (Field("YourField").search(/\band\b/gi) != -1)
    return "assure";
  //else
  return "assures";

However, I have to offer a huge caveat with this strategy of using the
presence of the word "and" to determine whether the subject of a
sentence is singular or plural, because it's fundamentally flawed.

For instance, "The Smith Family" is singular, but "The Smiths" is
plural, even though there's no "and" in there.  Likewise, "The Good
People of Acme Industries" is plural, as are subjects such as "your
parents" or "Bobby's parents."  Furthermore, a subject with the word
"and" in it could still be singular, such as "The Law Firm of Dewey,
Cheatem, and Howe," or "The Department of Child and Family Services."
You could also run into trouble with ampersands ("John & Jane Doe" is
singular, but "AT&T" is plural) or other symbols and words used instead
of "and."  In addition, you have to be careful of making cultural
assumptions, especially when dealing with things like proper names, or
assuming that the number of parents that a child may have is always
either one or two.

It may seem unlikely that you'll run into one of these types of cases
very often, but if you have a million records, a 99 percent accuracy
rate will still give you ten thousand incorrect results, which will be
very hard to find.

My point here is that these types of things can't always be divined with
an algorithm.  Computers are very good at calculations, but not at
things like parsing language.  A good database should tell you
explicitly whether the value is singular or plural.  (This is similar to
the problem with trying to capitalize only the first letter of each word
in a proper name such as "McDonald" or "Mies van der Rohe.")  The First
Law of Variable Data Printing is: Know Thy Data.

One way to avoid this kind of problem completely is to rearrange the way
you're wording things to use a verb that's number-neutral, that is,
something that will work regardless of whether the subject is singular
or plural.  For instance, you could change it to "can assure" or "will
assure" instead of "assure[s]".  Or sometimes you can switch to passive
voice, for instance, instead of "<Name> invite[s] you to <Event>," you
can say, "You are invited to <Event> by <Name>."

Dan


+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
FusionPro 5.0 Now Available!


Variable text on a curve and soft drop-shadows for variable text


LIMITED TIME upgrade offer of $299 per license for current customers:
http://fusionpro.printable.com/store/upgrade

New licenses available for $599 each at:
http://fusionpro.printable.com/store/

All FusionPro 5.0 customers to receive FusionPro 5.1 with
Adobe Acrobat 8 and InDesign CS3 support when released for FREE.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
--
Users of FusionPro Desktop have unlimited free email support. Contact Printable 
Support at [EMAIL PROTECTED]
--
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm

--
You are currently subscribed to fusionpro as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--


--
Note:  All e-mail sent to or from this address will be received or otherwise 
recorded by the e-mail recipients of this forum. It is subject to archival, 
monitoring or review by, and/or disclosure to someone other than the recipient. 
Our privacy policy is posted on www.printplanet.com
--

Reply via email to