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

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

cfparam in cfc?

  << 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:
Johnny Le
08/01/2006 01:19 PM

Does cfparam work well in CFC?  Occasionally I get errors that say a variable is not defined even though I have cfparam right above it to define the variable.   Does anyone know what is going?  Should I change all my cfparam to cfif statement to define my variables within CFCs? Johnny

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ben Nadel
08/01/2006 03:46 PM

Paraming is wicked cool no matter where you put it. Can you post your function code so we can see potential pit falls. ...................... Ben Nadel www.bennadel.com Does cfparam work well in CFC?  Occasionally I get errors that say a variable is not defined even though I have cfparam right above it to define the variable.  Does anyone know what is going?  Should I change all my cfparam to cfif statement to define my variables within CFCs? Johnny

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
08/01/2006 02:09 PM

> Does cfparam work well in CFC?  Occasionally I get errors > that say a variable is not defined even though I have cfparam > right above it to define the variable.  Does anyone know what > is going?  Should I change all my cfparam to cfif statement > to define my variables within CFCs? I haven't had any problems using CFPARAM within CFCs, but this doesn't work very well for variables local to CFC function calls, because you have to use the VAR keyword to make them local variables. So, you might want to post the code in question. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information!

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Brad Wood
08/01/2006 02:27 PM

What scope?  I think vars in the variables scope have to be referenced as variables.var_name or they won't work. ~Brad Does cfparam work well in CFC?  Occasionally I get errors that say a variable is not defined even though I have cfparam right above it to define the variable.  Does anyone know what is going?  Should I change all my cfparam to cfif statement to define my variables within CFCs? Johnny

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Johnny Le
08/01/2006 08:16 PM

Hmm, this could be it.  It is variables scope.  Although it only NOT works occasionally.  It doesn't fail every single time. What I do is I create a structure in the init method to hold the form and url variables that I passed into the CFC.  I use the cfparam to make sure the variable exists in the structure before I use it. Johnny ----- Excess quoted text cut - see Original Post for more -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Robertson-Ravo, Neil (RX)
08/02/2006 04:53 AM

Code? "This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant, Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business, Registered in England, Number 678540.  It contains information which is confidential and may also be privileged.  It is for the exclusive use of the intended recipient(s).  If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful.  If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910.  The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions." Visit our website at http://www.reedexpo.com Hmm, this could be it.  It is variables scope.  Although it only NOT works occasionally.  It doesn't fail every single time. What I do is I create a structure in the init method to hold the form and url variables that I passed into the CFC.  I use the cfparam to make sure the variable exists in the structure before I use it. Johnny ----- Excess quoted text cut - see Original Post for more -----


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

Search cf-talk

September 30, 2014

<<   <   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         

Designer, Developer and mobile workflow conference