Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning multiple values from component?

Status
Not open for further replies.

spook007

Programmer
May 22, 2002
259
US
I have a CFC that needs to return multiple values back to the requesting page. On the invoke side I can only get the values from the first variable, how do I get the rest?
 
I've read the reference manual and it talks about populating a structure with name-value pairs. Has anyone tried this before?
 
For anyone else with similar problem & for future reference.

<cfscript>
results = StructNew();
StructInsert(results,"average",intAverage)
StructInsert(results,"mean",intMean)
StructInsert(results,"percent",intPercent)
</cfscript>

<cfreturn results>

** make sure that the returntype for the function is set to "struct"**

When trying to retrieve values from the invoke side.

<cfoutput>#StructFind(analysisRet,"average")#, #StructFind(analysisRet,"mean")#, #StructFind(analysisRet,"percent")#</cfoutput>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top