Another Option:
<-cfloop index="i" from="1" to="#theSerNums.RecordCount#">
<-cfif structKeyExists(Form,'SerNum' & i)>
DoSomething
<-cfelse>
DoSomethingElse
<-/cfif>
<-/cfloop>
however what you have looks fine to me.
Mark
-----Original Message-----
From: Brian Scandale [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 25, 2002 1:11 PM
To: CF-Talk
Subject: -isDefined() finesse
I am trying to see if a particular dynamic variable is defined... but having
trouble building the ifDefined argument.
Form.SerNum1
Form.SerNum2
Form.SerNum3 ...etc. are built dynamically and then passed to an action form
below like below.
<-cfloop index="i" from="1" to="#theSerNums.RecordCount#">
<-cfif isDefined("Form.SerNum#i#")>
DoSomething
<-cfelse>
DoSomethingElse
<-/cfif>
<-/cfloop>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm