and to further what Larry said....

To just loop over the first 3 items you CFSET a variable called LoopCounter to 0 
(zero) before the
loop.  Then you increment it inside the loop (LoopCounter + 1).  When LoopCounter hits 
3 you use
CFBREAK to break out of the loop.

HTH

Bryan Stevenson
VP & Director of E-Commerce Development
Electric Edge Systems Group Inc.
p. 250.920.8830
e. [EMAIL PROTECTED]
---------------------------------------------------------
Macromedia Associate Partner
www.macromedia.com

----- Original Message -----
From: "Larry Juncker" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 7:26 AM
Subject: RE: Easy way to loop over first x items of long list


> Why not CFLOOP?
>
> <CFLOOP LIST="myList" INDEX="myListItem" DELIMITERS="'">
> <CFOUTPUT>#myListItem#</CFOUTPUT>
> </CFLOOP>
>
> -----Original Message-----
> From: Paul Sinclair [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 9:16 AM
> To: CF-Talk
> Subject: Easy way to loop over first x items of long list
>
>
> If I have a list of 10 items or so (0,1,2,3,4,5,6,7,8,9) and want to
> loop over just the first 3 items (for example), what's the easiest way?
> I can't find a List function that selects just the first x items of a
> list. I can use ListGetAt to select the 1st one, then the 2nd, then the
> 3rd, but if I wanted to loop through a large number of items in a long
> list, that gets tedious.
>
> I guess there is probably some List function that does this that I have
> just overlooked?
>
> Thanks,
> Paul
>
> 
______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
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