House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

cfscript and methods

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Cutter (CF-Talk)
05/17/2004 06:00 PM

When creating an instance of an object (component) within cfscript how would I call a method of that object using arguments[ie: myobject.init(ID);]? It's pretty straight forward using cfinvoke, but I'm not finding much documentation on component manipulation with cfscript... Cutter

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Barney Boisvert
05/17/2004 06:05 PM

Exactly as you proposed: <cfscript> obj = createObject("component", "path.to.component"); obj.init(application.dsn); imageList = obj.getImageListForSite(attributes.siteID); </cfscript> Cheers, barneyb ----- Excess quoted text cut - see Original Post for more -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Carabetta
05/17/2004 06:04 PM

>When creating an instance of an object (component) within cfscript how >would I call a method of that object using arguments[ie: >myobject.init(ID);]? It's pretty straight forward using cfinvoke, but >I'm not finding much documentation on component manipulation with >cfscript... > <cfscript>   Variables.myObject = createObject("component", "path.to.my.CFC");   Variables.myObject.init( customerID:ID, secondArgument:Value2 ); </cfscript> I believe you can also use "=" as your separator (customerID=ID), but the ":" is just what I've gotten used to. Regards, Dave.


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 21, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference