Question
Structure Help
There are 2 things that I'm not sure how to write with
structure in CF:
First: I'm calling a function and passing the whole struncture (it does not expect a return value)
Here is how I wrote the code and I got error:
<CFSET BuildMyLetter=BuildLetter(stLetterType)>
Second:
Within the function, I need to do something by looping the code based on one of the structure's key, that is, total page number, such as,
if stLetterType["TotalPage"]=1 the code is looped 1 time, if stLetterType["TotalPage"]=2, the code is looped 2 times.
I wrote my loop this way and generates this error:
The value "TotalPage" cannot be converted to a number
<CFFUNCTION name="BuildLetter">
<CFARGUMENT name="stLetterType" type="Struct" required="true">
<CFLOOP collection="#stLetterType#" item=#stLetterType[TotalPage]#>
my codes here
</cfloop>
</CFFUNCTION>
Please help!
First: I'm calling a function and passing the whole struncture (it does not expect a return value)
Here is how I wrote the code and I got error:
<CFSET BuildMyLetter=BuildLetter(stLetterType)>
Second:
Within the function, I need to do something by looping the code based on one of the structure's key, that is, total page number, such as,
if stLetterType["TotalPage"]=1 the code is looped 1 time, if stLetterType["TotalPage"]=2, the code is looped 2 times.
I wrote my loop this way and generates this error:
The value "TotalPage" cannot be converted to a number
<CFFUNCTION name="BuildLetter">
<CFARGUMENT name="stLetterType" type="Struct" required="true">
<CFLOOP collection="#stLetterType#" item=#stLetterType[TotalPage]#>
my codes here
</cfloop>
</CFFUNCTION>
Please help!
