Skip to main content
June 8, 2006
Question

cfloop -- "cannot convert number"

  • June 8, 2006
  • 4 replies
  • 428 views
Maybe I'm just having a brain malfunction, but I'm trying to create a cfloop and am getting "cannot convert x to a number"...

Here's what I have:

<cfset #myNumber# = 3000>
<cfoutput query="myQuery">
<tr>
<td><cfloop index="i" from="#myNumber#" to="#myNumber# + 5" step="1">#i#<br></cfloop>
</tr>
</cfoutput>

Basically, I want to start at 3000 at the beginning, then at each grouping of the output, show 5 increments...
    This topic has been closed for replies.

    4 replies

    BKBK
    Community Expert
    Community Expert
    June 8, 2006
    #myNumber + 5#
    Indeed.

    June 8, 2006
    Indeed. Thanks, that was it.
    Inspiring
    June 8, 2006
    > <cfloop index="i" from="#myNumber#" to="#myNumber# + 5"
    > step="1">

    #myNumber + 5#

    --
    Adam
    BKBK
    Community Expert
    Community Expert
    June 8, 2006
    Is this what you want?

    <cfset myNumber = 3000>
    <cfoutput query="myQuery" group="column_to_group_by">
    <tr>
    <cfloop index="i" from="#myNumber#" to="#myNumber# + 5" step="1">
    <td>#i#</td>
    </cfloop>
    </tr>
    </cfoutput>

    Inspiring
    June 8, 2006
    quote:

    Originally posted by: MartinGibbs
    Maybe I'm just having a brain malfunction, but I'm trying to create a cfloop and am getting "cannot convert x to a number"...

    Here's what I have:

    <cfset #myNumber# = 3000>
    <cfoutput query="myQuery">
    <tr>
    <td><cfloop index="i" from="#myNumber#" to="#myNumber# + 5" step="1">#i#<br></cfloop>
    </tr>
    </cfoutput>

    Basically, I want to start at 3000 at the beginning, then at each grouping of the output, show 5 increments...

    Try taking the query attribute out of your cfoutput tag.