Quantcast

cfparam in cfc?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

cfparam in cfc?

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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four times a year.
http://www.fusionauthority.com/quarterly

Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:248488
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: cfparam in cfc?

Brad Wood
What scope?  I think vars in the variables scope have to be referenced
as variables.var_name or they won't work.

~Brad

-----Original Message-----
From: Johnny Le [mailto:[hidden email]]
Sent: Tuesday, August 01, 2006 11:40 AM
To: CF-Talk
Subject: cfparam in cfc?

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



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four times a year.
http://www.fusionauthority.com/quarterly

Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:248520
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: cfparam in cfc?

Dave Watts
In reply to this post by Johnny Le
> 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!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four times a year.
http://www.fusionauthority.com/quarterly

Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:248509
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: cfparam in cfc?

Ben Nadel
In reply to this post by Johnny Le
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

-----Original Message-----
From: Johnny Le [mailto:[hidden email]]
Sent: Tuesday, August 01, 2006 12:40 PM
To: CF-Talk
Subject: cfparam in cfc?

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



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four times a year.
http://www.fusionauthority.com/quarterly

Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:248547
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cfparam in cfc?

Johnny Le
In reply to this post by Brad Wood
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


>What scope?  I think vars in the variables scope have to be referenced
>as variables.var_name or they won't work.
>
>~Brad
>
>-----Original Message-----
>From: Johnny Le [mailto:[hidden email]]
>Sent: Tuesday, August 01, 2006 11:40 AM
>To: CF-Talk
>Subject: cfparam in cfc?
>
>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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four times a year.
http://www.fusionauthority.com/quarterly

Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:248583
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cfparam in cfc?

Robertson-Ravo, Neil (RX)
In reply to this post by Johnny Le
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

-----Original Message-----
From: Johnny Le
To: CF-Talk
Sent: Wed Aug 02 01:15:23 2006
Subject: Re: cfparam in cfc?

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


>What scope?  I think vars in the variables scope have to be referenced
>as variables.var_name or they won't work.
>
>~Brad
>
>-----Original Message-----
>From: Johnny Le [mailto:[hidden email]]
>Sent: Tuesday, August 01, 2006 11:40 AM
>To: CF-Talk
>Subject: cfparam in cfc?
>
>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



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four times a year.
http://www.fusionauthority.com/quarterly

Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:248604
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4
Loading...