• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

referencing a returned array

New Here ,
Oct 23, 2006 Oct 23, 2006

Copy link to clipboard

Copied

I have a problem with referencing an array returned from a component.
But maybe this is just not possible, i don't know.

I have a method wich returns an array with component instances.
And i want to directly reference the methods in the component instances withing the returned array.
so if i were to use it like this:

<cfset x = myInstance.getClients()>
X would be the array. I can then process it further like this:
x[1].getAddress() would give me the clients address.

However i would want to directly reference it, without setting the x variable first.
However, the 'normal' syntax i would use does not work.
<cfoutput>#myInstance.getClients()[1].getAddress()#</cfoutput>

So does anyone how to directly reference an array returned from a components instance?
TOPICS
Advanced techniques

Views

269

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Oct 23, 2006 Oct 23, 2006
You can't. You need the variable.

Votes

Translate

Translate
LEGEND ,
Oct 23, 2006 Oct 23, 2006

Copy link to clipboard

Copied

LATEST
You can't. You need the variable.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation