Here is a function I use for building "smart" strings.  It adds two strings
together with the given delimiter if both exist.  If the latter ("data") is
empty (a blank or all space string), just the former ("line") is returned.
If the former is blank, the latter is returned.

 

function AppendField(line, data, delim) {

    if (RTrim(data) == "") return line;

    // because of return, implicit else

    if (line != "") {

        return RTrim(line + delim + data);

    } else {

        return data;

    }

}

 

 

Usage:

 

return ( AppendField(Field("Name"), Field("Title"), ", ") ; // note the
delimiter is a comma (,) followed by a space( ).

 

-or-

                // Effective creates an address block with empty lines
omitted

Address = AppendField(Field("First"), Field("Middle"), " ");

Address = AppendField(Address, Field ("Last"), " ");

Address = AppendField(Address, Field ("Title"), ", ");

Address = AppendField(Address, Field ("Address1"), "\n"); //  New Line
deliniation

Address = AppendField(Address, Field ("Address2"), "\n");

 

Line = AppendField(Field("City"), Field("State"), ", ");

Line = AppendField(Line, Field("Zip+4"), "  "); // double space deliniation

Line = AppendField(Line, Field("ForeignCountry"), " ");

 

Address = AppendField(Address, Line, "\n");

 

return Address;

 

Hope this helps.

 

Cheers.

 

From: Carrie Dodt [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 18, 2007 4:07 PM
To: FusionPro Users Forum
Subject: [fusionpro] suppressing a comma

 

 

I have two fields for a Christmas Card.

 

Name, Title                             (centered in the middle of the card)

 

I would like to suppress the comma if no title entered, so Name will appear
by itself.

 

Is there a rule for this?

 

thanks,

 

Carrie

 

 

 

Carrie Dodt

K&M PRINTING

Prepress Manager

847-884-1100 EXT. 307

847-884-1286 fax


+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- Calling all FP Web
Users! Do you have a question or lots of knowledge to share about FusionPro
Web? If so, join our Printable Web to Print Users' Forum today! Send email
to [EMAIL PROTECTED] to find out how!
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -- 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 -- 



+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 
Calling all FP Web Users!

Do you have a question or lots of knowledge to share about FusionPro Web?

If so, join our Printable Web to Print Users' Forum today!

Send email to [EMAIL PROTECTED] to find out how! 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-


--
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