Sheesh
Gift<cfif GetGifts.RecordCount GT 1>s</cfif>
If there is more than one gift, it puts an "S" on the end.
As for white space
<cfsetting enablecfoutputonly="yes">
<cfoutput>Gift</cfoutput>
<cfif GetGifts.RecordCount GT 1>
<cfoutput>s</cfoutput>
</cfif>
<cfsetting enablecfoutputonly="no">
OR
<cfsavecontent variable="var">
Gift<cfif GetGifts.RecordCount GT 1>
s
</cfif>
</cfsavecontent>
<cfoutput>#REReplace(var,"[^[:print:]]","","ALL")>
I really dont see whats wrong with Gift<cfif GetGifts.RecordCount GT
1>s</cfif>
Thats the most easierest to ready anyway
Steve
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, April 02, 2003 9:56 AM
To: CFAussie Mailing List
Subject: [cfaussie] Re: How to kill a space ?
OK, how about this then:
<CFSET Plural = "s">
<CFIF GetGifts.RecordCount IS 1>
<CFSET Plural = "">
</CFIF>
[etc]
> How about:
>
> <CFIF GetGifts.RecordCount IS 1>
> <CFSET Plural = "">
> <CFELSE>
> <CFSET Plural = "s">
> </CFIF>
>
> <CFOUTPUT>
> #GetGifts.RecordCount# Gift#Plural#
> </CFOUTPUT>
>
> Regards: Ayudh
>
> +--------------------------------------------------------------+
> | Turn on your Revenue Stream... |
> | Bolt on a Virtual Cash Register to your e-commerce site now. |
> | VeriPay from Xilo Online: http://www.xilo.com |
> +--------------------------------------------------------------+
> ----- Original Message -----
> From: "Andrew Dickinson" <[EMAIL PROTECTED]>
> To: "CFAussie Mailing List" <[EMAIL PROTECTED]>
> Sent: Wednesday, April 02, 2003 09:41
> Subject: [cfaussie] How to kill a space ?
>
>
> > Should be easy.
> >
> > I've written some code to add an "s" on the end of a word if the
> > record count is either zero or plural.
> >
> > The following code works fine ........
> >
> > Fragment 1
> > #GetGifts.RecordCount# Gift<CFIF GetGifts.RecordCount IS NOT
> > 1>s</CFIF>
> >
> > e.g.
> > 0 Gifts
> > 1 Gift
> > 2 Gifts
> >
> > ..... but when I split the line, and therefore make the
> code easier to
> > read .....
> >
> > Fragment 2
> > #GetGifts.RecordCount# Gift
> > <CFIF GetGifts.RecordCount IS NOT 1>
> > s
> > </CFIF>
> >
> > .... it goes all goofy
> >
> > e.g.
> > 0 Gift s
> > 1 Gift
> > 2 Gift s
> >
> > How can I keep my nice formatting in fragment 2, but not show that
> > annoying space before the "s" ?
> >
> > ---
> > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To
> > unsubscribe send a blank email to
> [EMAIL PROTECTED]
> >
> > MX Downunder AsiaPac DevCon - http://mxdu.com/
>
>
> ---
> You are currently subscribed to cfaussie as:
> [EMAIL PROTECTED] To unsubscribe send a blank email to
> [EMAIL PROTECTED]
>
> MX Downunder AsiaPac DevCon - http://mxdu.com/
>
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/