After hearing and reading alot recently about declaring local variables in my functions I decided to go ahead and re-examine my CFC's and declare local variables where necessary. Take the following cffunction block for example:
cffunction name=getBadDebt displayname=Check For Bad Debt
cffunction name=getBadDebt displayname=Check For Bad
Debt returntype=string
cfset var qBadDebt = /
cfargument name=SSN type=numeric required=true
default=0 /
You have to place your CFARGUMENT tags first, followed by your local
variable declarations, followed by everything else.
Dave
SHow us the code. How did you add the local var? Did you do cfset var
qgetbaddebt = immidiately after your cfargument tag?
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
move the var statement below cfargument:
cffunction name=getBadDebt displayname=Check For Bad Debt
returntype=string
cfargument name=SSN type=numeric required=true default=0 /
cfset var qBadDebt = /
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
Try moving the cfargument tag up
-Original Message-
From: Nate Petersen [mailto:[EMAIL PROTECTED]
Sent: Thursday, 27 November 2003 9:44 a.m.
To: CF-Talk
Subject: Can anyone see a problem with this cffunction block?
After hearing and reading alot recently about declaring local variables
I believe that cfarguments must come directly after the cffunction.If
you move the cfset down a line I think it should work.
Marlon
Nate Petersen wrote:
After hearing and reading alot recently about declaring local
variables in my functions I decided to go ahead and re-examine my
CFC's
You should place cffunction tag 1st, then cfargument tag 2nd then cfset
var tag 3rd. Place things in that order and everything will work fine.
TK
-Original Message-
From: Nate Petersen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 4:44 PM
To: CF-Talk
Subject: Can anyone see
7 matches
Mail list logo