In earlier objects, I've used this get method without problems, the difference being I explicitly defined the variables in the instance data. Why would I get this error only when accessing the method directly?
Here is the code for the get method:
<cffunction name="get" output="no" hint="Get a variable from the instance data">
<cfargument name="what" type="string" required="yes" hint="Item to get">
<cfif StructKeyExists(variables.instance,arguments.what)>
<cfreturn variables.instance["#arguments.what#"]>
<cfelse>
<cfreturn ''>
</cfif>
</cffunction>
And here is the code I use to populate the variables.instance struct:
<cfquery name="contact" datasource="#variables.ds#">
SELECT * FROM contact
WHERE id = "#arguments.id#"
</cfquery> <cfif contact.RecordCount GT 0>
<cfloop list="#contact.columnList#" index="column">
<cfset variables.instance['#column#'] =
contact['#column#']>
</cfloop>
</cfif>Note that the get method has no return type, because it is used to get both simple and complex values, but the value I am trying to get is a string.
Thanks, Ken
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
