I have a variable <cfset takeFour = 0 >. Then I have a loop that I want to run 4 times.
<cfset takeFour = 0 >
<cfloop query="getVids" condition="takeFour LTE 4"> <cfset takeFour= takeFour + 1/>...
The CF debugger says there is an attribute validation error for this tag, however this syntax must be correct. Any ideas?
When using cfloop to process a request, the acceptable attributes are: query, startRow, and endRow. The condition is not used when the request, so the compiler gives you an attribute validation error.
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_j-l_10.html
condition cfloop , , . :
<cfloop query="getVids"> <cfset takeFour = takeFour + 1 /> <cfif takeFour GT 4> <cfbreak /> </cfif> </cfloop>
, , :
<cfloop query="getVids" startrow="1" endrow="4"> </cfloop>
Source: https://habr.com/ru/post/1788283/More articles:C ++ Inherited template classes and initialization lists - c ++объявить подтип параметра в интерфейсе Java, использовать подтипы в методах реализации Java - javaHow to adjust screen orientation for other applications? - androidБаза данных NoSQL и отчетность - databaseWhat is the purpose of the prefix + in excel, in-cell formulas? - excelError with javascript in Firefox - javascriptWhat is the difference between $ (document) .ready () and the inclusion of a script at the end of the body? - javascriptIs there a variant of the jQuery live () function that is not event bound? - jqueryHow can I get cell value from jqGrid column to do conditional formatting for backcolor - jqueryBest Practices for Struts 2 CRUD - crudAll Articles