I don't know if this is the best way to do it, but this should work:

for (i = 1; i lte myQuery.recordcount; i=i+1)
{
        if (myQuery.myColName[i] IS 1)
                myVar = 1;
}

Is this actually all you want the loop to do?  If so, it might be more
efficient to pull a count of records from your DB where mycolname=1 and set
myvar=1 if the count is positive.

Of course, you may have simply used that as an example.  :-)



  --Ben Doom
    Programmer & General Lackey
    Moonbow Software

: -----Original Message-----
: From: Steven Durette [mailto:[EMAIL PROTECTED]]
: Sent: Thursday, November 21, 2002 3:24 PM
: To: CF-Talk
: Subject: cfscript equivalent for cfloop?
:
:
: Is there an equivalent of  to be used with cfscript?
:
: I have code similar to this:
:
: <cfloop query="myQuery">
:     <cfif myQuery.myColName IS 1>
:         <cfset myVar = 1>
:     </cfif>
: </cfloop>
:
: This loop is surrounded on both sides by cfscript
: blocks and I would like to make it all one cfscript
: block.
:
: Thanks,
: Steve
: 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to