I disagree. First, if you want to increment variable, and keep it, then
yes, <cfset x = x+1> makes more sense. However, if you need the higher
value just temporarily (as I showed in the link demo), then it _does_
make sense. Yes, you can do:

<cfoutput>... #x+1#...</cfoutput>

But as for that being 'better' - it's a matter of style. Personally I
prefer the first case. I use the syntax above for more complex crap,
like alternating table row colours:

                                <td
class="tableRow#((qThreads.currentRow mod 2) + 1)#">#numMessages#</td>

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email    : [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Sean A Corfield [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, August 02, 2002 11:19 AM
> To: CF-Talk
> Subject: Re: Increments 
> 
> 
> On Friday, August 2, 2002, at 07:53 , Raymond Camden wrote:
> > Um. No. incrementValue _returns_ the higher value. It doesn't change
> > url.page. If you cfoutput url.page after this code, it is 
> not changed.
> 
> Ah, good. So in fact there's even less reason to use 
> incrementValue() now 
> than ever before...
> 
> <cfset x = x + 1/>
> <cfset x = incrementValue(x)/>
> 
> The first is shorter (and, in my opinion, clearer code).
> 
> And clearly:
> 
>       #x + 1#
> 
> is shorter and easier to read than:
> 
>       #incrementValue(x)#
> 


______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to