I am trying to write a custom tag that
will, among other things, add an element
to an array whose name can vary from situation
to situation. This array is always stored as a
session variable. I have been trying to pass
the name of the array as a character string
and then manipulate it in the custom tag
with no luck.
Here is how I call the tag:
( session.aDirectoryClicked array is created in Application.cfm
and initialized earlier )
<CFMODULE template="../BumpHitCounter.cfm"
aIDs="aDirectoryClicked"
nNumIDs=#ArrayLen( session.aDirectoryClicked )#
ThisID=#URL.DirectoryID#>
=====
Here is a snippet from BumpHitCounter.cfm that does not work:
<CFLOOP INDEX="n" FROM="1" TO="#Attributes.nNumIDs#">
<CFIF "Caller.#Attributes.aIDs# [n]" EQ Attributes.ThisID>
<CFSET Variables.WasClicked = "Yes">
<CFSET n = Attributes.nNumIDs + 1>
</CFIF>
</CFLOOP>
<CFIF Variables.WasClicked EQ "No">
<CFSET Variables.tmp = ArrayAppend( "Caller.#Attributes.aIDs#",
#Attributes.ThisID# )>
</CFIF>
=====
Here is the error message that is thrown:
Error Diagnostic Information
Parameter 1 of function ArrayAppend which is now
"Caller.aDirectoryClicked" must be an array
The error occurred while evaluating the expression:
Variables.tmp = ArrayAppend( "Caller.#Attributes.aIDs#",
#Attributes.ThisID# )
=====
Any ideas?
Thanks in advance.
Joe Tartaglia
High Caliber Systems
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists