Within you cfc function set all the values you require in a structure and return that structure.

<!--- tableCfc function --->
<cffunction name="getTableData">
 <cfset var tableData = structNew() />
 <cfset tableData.tablename = "somevalue" />
 <cfset tableData.tabletype = "anothervalue" />
 <cfreturn tableData />
</cffunction>

On the calling page, use it like so:
<cfset tableStruct= tableCfc.getTableData() />
<cfset tablename = tableStruct.tablename />


On 3/10/06, Hamoud, Ryan N. <[EMAIL PROTECTED]> wrote:
So is not possible to accomplish this with a CFC?  When i did this with my custom tage i was able to access allmy constants on any page as
follows.....example   <cfset tablename = #C_LV#>   I would still like to be able to do this.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Charlie Griefer
Sent: Thursday, March 09, 2006 3:31 PM
To: [email protected]
Subject: Re: [CFCDev] cfc scope issues


Ryan  - a quick primer on scopes and CFCs:

http://ray.camdenfamily.com/downloads/cfcscopes.pdf

On 3/9/06, Hamoud, Ryan N. <[EMAIL PROTECTED]> wrote:
>
>
> I am new to cfc's and was working on trying to convert some of my custom
> tags to cfc's. The one problem I come across is trying to use the caller
> scope.
>  In my custom Tag which is below I did this by:
>
> <cfoutput query="coreLV">
>          <cfset " caller.C_#listchangedelims(
> listchangedelims(listchangedelims(coreLV.legalValue,'_','-'),'_','
> '),'_','/')#" = coreLV.lKey>
>  </cfoutput>
>
>  basically this just loops through a query and set up a bunch of constantsto
> be used on any cfm page.
>  Now i would like to do the same in a cfc but cant get this to work. This is
> what i have come up with so far..... Please Help
>
>  <CFFUNCTION NAME="createCoreConstants" access="remote" returntype="void">
>  <CFARGUMENT NAME="tablename" type="string" required="yes">
>          <cfquery name="coreLV" datasource="#request.app.DSN#"
> blockfactor="10" cachedwithin="#request.app.queryCache30#">
>                  SELECT
> dbo.#ARGUMENTS.tableName#.legalValue,
> dbo.#ARGUMENTS.tableName#.lKey
>                  FROM dbo.#ARGUMENTS.tableName#
>                  where dbo.#ARGUMENTS.tableName#.isActive=1
>          </cfquery>
>          <cfoutput query="coreLV">
>                  <cfset "CALLER.C_#listchangedelims(
> listchangedelims(listchangedelims(coreLV.legalValue,'_','-'),'_','
> '),'_','/')#" = coreLV.lKey>
>          </cfoutput>
>  </CFFUNCTION>
>
> Basically in the end I would like to execute a cfc that will loop through a
> table and create constants for
> each record in the table that are available to be accessed on any page
>
> Thanks for you Help in advance
> Ryan Hamoud
> ----------------------------------------------------------
>  You are subscribed to cfcdev. To unsubscribe, send an email to
> [email protected] with the words 'unsubscribe cfcdev' as the subject of the
> email.
>
>  CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
> ( www.cfxhosting.com).
>
>  An archive of the CFCDev list is available at
> www.mail-archive.com/[email protected]


--
Charlie Griefer

================================================
"...All the world shall be your enemy, Prince with a Thousand Enemies,
and whenever they catch you, they will kill you. But first they must catch
you, digger, listener, runner, prince with a swift warning.
Be cunning and full of tricks and your people shall never be destroyed."


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]




----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to