I guess I should've been more clear about what I want to do.
<CFIF isDefined("queryname")>
<CFLOOP query="Queryname">
<CFELSE>
<CFLOOP index="x" list="listname">
</CFIF>
I have gotten a suggestion to rewrite it as
<CFIF isDefined("queryname")>
<CFSET count=queryname.recordcount>
<CFELSE>
<CFSET count=#ListLen(listname)#>
</CFIF>
<CFLOOP from="0" to="#count#">
</cfloop>
-----Original Message-----
From: Dylan Bromby [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 9:20 PM
To: CF-Talk
Subject: RE: Conditional loops
why don't you just use the CONDITION attribute of CFLOOP?
-----Original Message-----
From: Bud [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 4:59 PM
To: CF-Talk
Subject: Re: Conditional loops
On 1/16/01, Ruslan Sivak penned:
>Is there a way to have conditional loops such as
>
><CFIF something>
> <CFLOOP parameters1>
><CFELSE>
> <CFLOOP parameters2>
></CFIF>
>
> </CFLOOP>
Nope. You'll have to put the opening and closing loop tags either
both inside each cfif, cfelse block, or put them outside the entire
cfif.
<CFIF this IS "that">
<cfloop query="example1">
#variable#
</cfloop>
<CFELSE>
<cfloop query="example2">
#variable#
</cfloop>
</CFIF>
Or
<cfloop query="example1">
<CFIF this IS "that">
#variable1#
<CFELSE>
#variable2#
</CFIF>
</cfloop>
--
Bud Schneehagen - Tropical Web Creations
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists