Looping in CFSCRIPT
Hi Everyone. Does anyone know how to loop within CFSCRIPT over a query and/or a comma list, like you can with CFLOOP? Also, does anyone konw if there is a good guide to CFSCRIPT anywhere as the MM documentation of CFSCRIPT is pretty much none existant. Thanks Andrew. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: Looping in CFSCRIPT
funny u mention that.. i was just looking today and came across this http://www.houseoffusion.com/script.ppt and http://tutorial84.easycfm.com/ you can use FOR and WHILE loops .. its in the ppt above get some caffine try to google: cfscript joe velez [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: Looping in CFSCRIPT
i havent actually played w/ cfscript too much, but in reading about it briefly i believe its something like this for a comma del. list cfscript var=0; /* not sure if var = 0 if you dont set it first, you can probably exclude this, but set it to be safe */ while(VAR lte listlen(yourlist)) { var++; // this should work or ... var=var+1; // // do stuff } /cfscript for a query cfscript var=0; while(VAR lte query.recordcoount) // might need #query.recordcount# { var++; // this should work or ... var=var+1; // // do stuff } /cfscript [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: Looping in CFSCRIPT
Thanks... - Original Message - From: joe velez [EMAIL PROTECTED] Date: Thu, 09 Sep 2004 06:03:47 -0400 Subject: Re: Looping in CFSCRIPT To: CF-Talk [EMAIL PROTECTED] i havent actually played w/ cfscript too much, but in reading about it briefly i believe its something like this for a comma del. list cfscript var=0; /* not sure if var = 0 if you dont set it first, you can probably exclude this, but set it to be safe */ while(VAR lte listlen(yourlist)) { var++; // this should work or ... var=var+1; // // do stuff } /cfscript for a query cfscript var=0; while(VAR lte query.recordcoount) // might need #query.recordcount# { var++; // this should work or ... var=var+1; // // do stuff } /cfscript [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: Looping in CFSCRIPT
Here's my write up on using cfscript for looping over a query: http://gregs.tcias.co.uk/cold_fusion/outputting_queries_with_cfscript.php Hope this helps G On Thu, 9 Sep 2004 10:42:18 +0100, Andrew Dixon [EMAIL PROTECTED] wrote: Hi Everyone. Does anyone know how to loop within CFSCRIPT over a query and/or a comma list, like you can with CFLOOP? Also, does anyone konw if there is a good guide to CFSCRIPT anywhere as the MM documentation of CFSCRIPT is pretty much none existant. Thanks Andrew. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: Looping in CFSCRIPT
come on G .. php??? hehe =^) -- that's for Carsten god .. you know who you are! [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: Looping in CFSCRIPT
He has a point!!! - Original Message - From: joe velez [EMAIL PROTECTED] Date: Thu, 09 Sep 2004 06:20:23 -0400 Subject: Re: Looping in CFSCRIPT To: CF-Talk [EMAIL PROTECTED] come on G .. php??? hehe =^) -- that's for Carsten god .. you know who you are! [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: Looping in CFSCRIPT
// list for(i = 1;i LE ListLen(list);i=i+1){ element = ListGetAt(list,i); } // query for(i = 1;i LE query.recordCount;i=i+1){ value = query.field[i]; } Pascal -Original Message- From: Andrew Dixon [mailto:[EMAIL PROTECTED] Sent: 09 September 2004 11:42 To: CF-Talk Subject: Looping in CFSCRIPT Hi Everyone. Does anyone know how to loop within CFSCRIPT over a query and/or a comma list, like you can with CFLOOP? Also, does anyone konw if there is a good guide to CFSCRIPT anywhere as the MM documentation of CFSCRIPT is pretty much none existant. Thanks Andrew. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: Looping in CFSCRIPT
Here is a starting point. http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/cfscript.htm Doug Andrew Dixon wrote: Hi Everyone. Does anyone know how to loop within CFSCRIPT over a query and/or a comma list, like you can with CFLOOP? Also, does anyone konw if there is a good guide to CFSCRIPT anywhere as the MM documentation of CFSCRIPT is pretty much none existant. Thanks Andrew. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: Looping in CFSCRIPT
I know, I know... :) >From a time before BlueDragon free version was around, I am actually in the process of re-building the site to use cfml and Mach-ii as the framework. Still no harm in trying out PHP, it has a very rich feature set... G On Thu, 9 Sep 2004 11:31:26 +0100, Andrew Dixon [EMAIL PROTECTED] wrote: He has a point!!! - Original Message - From: joe velez [EMAIL PROTECTED] Date: Thu, 09 Sep 2004 06:20:23 -0400 Subject: Re: Looping in CFSCRIPT To: CF-Talk [EMAIL PROTECTED] come on G .. php??? hehe =^) -- that's for Carsten god .. you know who you are! [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]