Ian,

this is the same as you php but in cfscript:)  should work.  But you're
probably better using cf loop as the other examples show, but does depend on
what you want to do with _do some action_:)

<cfscript>
for (i=1; i < records; i = i + 1) {
    do some action;
}
</cfscript>


----- Original Message -----
From: "Ian Westbrook" <[EMAIL PROTECTED]>
To: "cfug dev list" <[EMAIL PROTECTED]>
Sent: Friday, November 29, 2002 12:27 PM
Subject: [ cf-dev ] for loops...


Hi.
Been doing a lot of PHP lately, so very rusty with CF (still using 4.5) -
and I was never very good at it to begin with ;-)

I want to do a for loop for a number of records. I'm using this:

<cfset records = #ListLen(form.story_id)#>

which sets #records# to, say, 2

then I want something like

for ($i=1;$i<#records#;$i++) {
do some action
}

but I need the CF equivalent. can anyone suggest anything?

TIA

ianwest



Ian Westbrook,
FutureDream Media Limited,
(W): www.futuredream.net
(E): [EMAIL PROTECTED]
(T): +44 (0) 1303 258 985
(M): 07939 510 812

This message may contain information which is legally privileged and/or
confidential. If you are not the intended recipient, you are hereby notified
that any unauthorised disclosure, copying, distribution or use of this
information is strictly prohibited. Such notification notwithstanding any
comments, opinions, information or conclusions expressed in this message are
those of the originator, not of FutureDream Media Ltd, unless otherwise
explicitly and independently indicated by an authorised representative of
FutureDream Media Ltd.


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to