macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

Handling undefined variable with a dynamic var

Subject: Handling undefined variable with a dynamic var
From: "ChuckWWW"
Date: Mon, 20 Aug 2007 15:32:56 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
I'm trying to account for the possibility of a piece of code trying to do 
something with an undefined dynamic variable, eg:

 <cfset thenextcount = #getpodetail.recordcount# + 1>
 <cfset theunitpricecheck = #Evaluate("unitprice" & thenextcount)# >

 This bombs occasionally -- I'd like to handle it by doing something like this:

  [h]<cfparam name="#Evaluate("unitprice" & thenextcount)#" default="1">[/h]

 But no workie!  

 Suggestions?

 thanks,

 Chuck


<Prev in Thread] Current Thread [Next in Thread>