It is prudent to remember that TAGS hide a lot of what is actually going on
and example code is often not a solution but a snippet - just to show
syntactical relationships.
When we specify the RETURNVARIABLE in CFINVOKE we are telling it the
variable we want the data to go into. �The tag itself does the assignment
something like the following if we were writing it ourselves in "custom tag
code"....
<CFSET
rv=SetVariable("Caller.#Attributes.returnvariable#",theVariableBeingReturned)>
� � � � OR (in CFSCRIPT)
<CFSCRIPT>
SetVariable("Caller.#Attributes.returnvariable#",theVariableBeingReturned);
</CFSCRIPT>
What also needs to be remembered in the example from the book (despite the
typos) is that the component that it is calling is not defined. �It may
well be that the GETAUTH method does not return anything but actually sets
members inside the object itself. �All the other examples in the same area
imply there is no return value to assign. �Therefore, the code (in the
example - aside from typos) is probably correct.
So - it is only necessary to assign a result if your method actually
returns one. �It may not return one but may set a member in the object
itself.
So... in the example from the book.... it may be possible to do the
following (depending on the component definition - which we have not been
given).....
<CFSCRIPT>
� � � � // ......
� � � �corpQCFC.getAuth(argumentsCollention = tempStruct);
� � � � WriteOutput(corpQCFC.userAuthenticated);
</CFSCRIPT>
Gary Menzel
IT Operations Brisbane -+- ABN AMRO Morgans Limited
Level 29, 123 Eagle Street BRISBANE QLD 4000
PH: 07 333 44 828 �FX: �07 3834 0828
[EMAIL PROTECTED] wrote on 01/25/2003 10:39:58 PM:
> Hey guys and Gals
>
> Just thought I would bring this up.
>
> I have been scanning through the help documentation and came accross
> what I would call a very bad error in reference to invoking
> components using CFSCRIPT.
>
> This is what the documentation says to do.
>
> ==========================================
> <cfscript>
> � corpQCFC = createObject("component", "corpSecurity");
> � tempStruct = structNew();
> � tempStruct.username = "skippy"
> � tempStruct.password = "dippy"
> � corpQCFC.getAuth(argumentsCollention = tempStruct);
> </cfscript>
> ============================================
>
> First thing is the miss spelling of the miss spelling of
> "argumentsCollention". �But thats not all of it. �You actually need to
pass
> "argumentCollection" as a singular, not "argumentsCollection".
>
> Now, going by what it has in the documentation, I would say that
> thats all you need to do, and it will return the result just like
> using CFINVOKE. �Unfortunalty not. �You need to assign the result
tosomething.
>
> Below is the way to do it
>
> ==========================================
> <cfscript>
> � corpQCFC = createObject("component", "corpSecurity");
> � tempStruct = structNew();
> � tempStruct.username = "skippy"
> � tempStruct.password = "dippy"
> � result = corpQCFC.getAuth(argumentCollection = tempStruct);
> </cfscript>
> ============================================
>
> Well there you go. �Do with it what you will.
>
> Regards
> Steve Onnis
> Domain Concept Designs
> +61 422 337 685
> +61 3 9431 4249
>
> http://www.domainconceptdesigns.com
> [EMAIL PROTECTED]
>
> [image removed]
>
> http://www.cfcentral.com.au
> [EMAIL PROTECTED]
>
> [image removed]
>
> [image removed]
>
> ("If you think it can't be done, you haven't asked me!") - Steve Onnis
>
> ---
> You are currently subscribed to cfaussie as:
[EMAIL PROTECTED]
> To unsubscribe send a blank email to
[EMAIL PROTECTED]
>
> MX Downunder AsiaPac DevCon - http://mxdu.com/
---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/