Answered
How to loop through token values
I'm trying to create a simple loop that runs through a bunch
of comma delimted values in a string and adds them together. What
is the best way to do this?
Currently, my code looks something like this
<cfset basevalue = "0">
<cfset count = "1">
<cfset token = getToken(myString,count,",")>
<cfloop condition = "token NEQ NULL">
<cfset token = getToken(myString,count,",")>
<cfset basevalue = basevalue + token>
<cfset count = count + 1>
</cfloop>
This doesn't seem to be working. Any ideas?
Currently, my code looks something like this
<cfset basevalue = "0">
<cfset count = "1">
<cfset token = getToken(myString,count,",")>
<cfloop condition = "token NEQ NULL">
<cfset token = getToken(myString,count,",")>
<cfset basevalue = basevalue + token>
<cfset count = count + 1>
</cfloop>
This doesn't seem to be working. Any ideas?