IsDefined() bug?

2002-10-25 Thread todd
Is this not possible?

cfset form.mytest = 2
cfdump var=#FORM#
cfoutput#FORM[mytest]#/cfoutput
cfif isdefined('FORM[mytest]')
Yup
/cfif

Error:
Parameter 1 of function IsDefined, which is now 
quot;FORM[mytest]quot;, must be a syntactically valid variable name.

-- 

Todd Rafferty ([EMAIL PROTECTED]) - http://www.web-rat.com/ |
Team Macromedia Volunteer for ColdFusion   |
http://www.macromedia.com/support/forums/team_macromedia/  |
http://www.flashCFM.com/   - webRat (Moderator)|
http://www.ultrashock.com/ - webRat (Back-end Moderator)   |
   Speakeasy DSL - http://www.speakeasy.net/refer/18280|


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.



Re: IsDefined() bug?

2002-10-25 Thread Randell B Adkins
Use the evaluate function

 [EMAIL PROTECTED] 10/25/02 09:30AM 
Is this not possible?

cfset form.mytest = 2
cfdump var=#FORM#
cfoutput#FORM[mytest]#/cfoutput
cfif isdefined('FORM[mytest]')
Yup
/cfif

Error:
Parameter 1 of function IsDefined, which is now 
quot;FORM[mytest]quot;, must be a syntactically valid variable
name.

-- 

Todd Rafferty ([EMAIL PROTECTED]) - http://www.web-rat.com/ |
Team Macromedia Volunteer for ColdFusion   |
http://www.macromedia.com/support/forums/team_macromedia/  |
http://www.flashCFM.com/   - webRat (Moderator)|
http://www.ultrashock.com/ - webRat (Back-end Moderator)   |
   Speakeasy DSL - http://www.speakeasy.net/refer/18280|



~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm



Re: IsDefined() bug?

2002-10-25 Thread todd
Nevermind, I should be using StructKeyExists()

~Todd

On Fri, 25 Oct 2002 [EMAIL PROTECTED] wrote:

 Is this not possible?
 
 cfset form.mytest = 2
 cfdump var=#FORM#
 cfoutput#FORM[mytest]#/cfoutput
 cfif isdefined('FORM[mytest]')
 Yup
 /cfif
 
 Error:
 Parameter 1 of function IsDefined, which is now 
 quot;FORM[mytest]quot;, must be a syntactically valid variable name.
 
 

-- 

Todd Rafferty ([EMAIL PROTECTED]) - http://www.web-rat.com/ |
Team Macromedia Volunteer for ColdFusion   |
http://www.macromedia.com/support/forums/team_macromedia/  |
http://www.flashCFM.com/   - webRat (Moderator)|
http://www.ultrashock.com/ - webRat (Back-end Moderator)   |
   Speakeasy DSL - http://www.speakeasy.net/refer/18280|


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com



Re: IsDefined() bug?

2002-10-25 Thread todd
Trying to avoid evaluate().  I have my answer already, thanks anyway.

On Fri, 25 Oct 2002, Randell B Adkins wrote:

 Use the evaluate function
 
  [EMAIL PROTECTED] 10/25/02 09:30AM 
 Is this not possible?
 
 cfset form.mytest = 2
 cfdump var=#FORM#
 cfoutput#FORM[mytest]#/cfoutput
 cfif isdefined('FORM[mytest]')
 Yup
 /cfif
 
 Error:
 Parameter 1 of function IsDefined, which is now 
 quot;FORM[mytest]quot;, must be a syntactically valid variable
 name.
 
 

-- 

Todd Rafferty ([EMAIL PROTECTED]) - http://www.web-rat.com/ |
Team Macromedia Volunteer for ColdFusion   |
http://www.macromedia.com/support/forums/team_macromedia/  |
http://www.flashCFM.com/   - webRat (Moderator)|
http://www.ultrashock.com/ - webRat (Back-end Moderator)   |
   Speakeasy DSL - http://www.speakeasy.net/refer/18280|


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.



RE: IsDefined() bug?

2002-10-25 Thread Raymond Camden
No! Just change your isdefined:

cfif isDefined(form.mytest)

If you need mytest to be dynamic (ie, its a pointer to the field name),
then you would use

cfif isDefined(form.#mytest#)

===
Raymond Camden, ColdFusion Jedi Master for Hire

Email: [EMAIL PROTECTED]
WWW  : www.camdenfamily.com/morpheus
Yahoo IM : morpheus

My ally is the Force, and a powerful ally it is. - Yoda 

 -Original Message-
 From: Randell B Adkins [mailto:AdkinsR;GAO.GOV] 
 Sent: Friday, October 25, 2002 9:13 AM
 To: CF-Talk
 Subject: Re: IsDefined() bug?
 
 
 Use the evaluate function
 
  [EMAIL PROTECTED] 10/25/02 09:30AM 
 Is this not possible?
 
 cfset form.mytest = 2
 cfdump var=#FORM#
 cfoutput#FORM[mytest]#/cfoutput
 cfif isdefined('FORM[mytest]')
 Yup
 /cfif
 
 Error:
 Parameter 1 of function IsDefined, which is now 
 quot;FORM[mytest]quot;, must be a syntactically valid variable
 name.
 
 -- 
 
 Todd Rafferty ([EMAIL PROTECTED]) - http://www.web-rat.com/ |
 Team Macromedia Volunteer for ColdFusion   |
 http://www.macromedia.com/support/forums/team_macromedia/  |
 http://www.flashCFM.com/   - webRat (Moderator)|
 http://www.ultrashock.com/ - webRat (Back-end Moderator)   |
Speakeasy DSL - http://www.speakeasy.net/refer/18280|
 
 
 
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



Re: IsDefined() bug?

2002-10-25 Thread Mike Wokasch
Todd
Why not just do:
cfif isDefined(form.mytest) ?

variable[] isn't really a true variable name.  Think of [] as an operator 
like + and -.

I think that MX fixes that bug.

Mike Wokasch

At 09:30 AM 10/25/2002 -0400, you wrote:
Is this not possible?

cfset form.mytest = 2
cfdump var=#FORM#
cfoutput#FORM[mytest]#/cfoutput
cfif isdefined('FORM[mytest]')
Yup
/cfif

Error:
Parameter 1 of function IsDefined, which is now
quot;FORM[mytest]quot;, must be a syntactically valid variable name.

--

Todd Rafferty ([EMAIL PROTECTED]) - http://www.web-rat.com/ |
 Team Macromedia Volunteer for ColdFusion   |
http://www.macromedia.com/support/forums/team_macromedia/  |
http://www.flashCFM.com/   - webRat (Moderator)|
http://www.ultrashock.com/ - webRat (Back-end Moderator)   |
Speakeasy DSL - http://www.speakeasy.net/refer/18280|



~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



RE: IsDefined() bug?

2002-10-25 Thread Mark A. Kruger - CFG
Todd, I do Isdefined('form.mytest')  all the time and it works well.  I
think you should use structkeyexists( ) if you want to use the bracket
syntax.

-mk

-Original Message-
From: [EMAIL PROTECTED] [mailto:todd;web-rat.com]
Sent: Friday, October 25, 2002 8:30 AM
To: CF-Talk
Subject: IsDefined() bug?


Is this not possible?

cfset form.mytest = 2
cfdump var=#FORM#
cfoutput#FORM[mytest]#/cfoutput
cfif isdefined('FORM[mytest]')
Yup
/cfif

Error:
Parameter 1 of function IsDefined, which is now
quot;FORM[mytest]quot;, must be a syntactically valid variable name.

--

Todd Rafferty ([EMAIL PROTECTED]) - http://www.web-rat.com/ |
Team Macromedia Volunteer for ColdFusion   |
http://www.macromedia.com/support/forums/team_macromedia/  |
http://www.flashCFM.com/   - webRat (Moderator)|
http://www.ultrashock.com/ - webRat (Back-end Moderator)   |
   Speakeasy DSL - http://www.speakeasy.net/refer/18280|



~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm



Re: IsDefined() bug?

2002-10-25 Thread Stephen Moretti
 Use the evaluate function


Do you really want Ray Camden on your case???  ;oD

FWIW : that won't work anyway.
   . with IsDefined(evaluate(FORM['mytest'])  you get the same response as
Todd's code.
   . with IsDefined(#evaluate(FORM['mytest']#), CF evaluates
FORM['mytest'] out to its content, which will fail if the variable is not
defined.
   . with IsDefined(evaluate(attributes['fuseaction'])) you get the same as
with #'s in the isdefined.

As Todd says, he should be using StructKeyExists() to see if mytest is in
the struct FORM or Ray's example of cfif isDefined(form.#mytest#)

Regards

Stephen


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



Re: IsDefined() bug?

2002-10-25 Thread Sean A Corfield
On Friday, Oct 25, 2002, at 06:38 US/Pacific, Mark A. Kruger - CFG 
wrote:
 Todd, I do Isdefined('form.mytest')  all the time and it works well. 
  I
 think you should use structkeyexists( ) if you want to use the 
 bracket
 syntax.

Note that structKeyExists() and isDefined() have slightly different 
meanings.

If you have a struct and you assign a Java null to one of the keys, 
then structKeyExists() will yield true but isDefined() will yield false.

It's an edge case but it's something to watch out for...

An Architect's View -- http://www.corfield.org/blog/

Macromedia DevCon 2002, October 27-30, Orlando, Florida
Architecting a New Internet Experience
Register today at http://www.macromedia.com/go/devcon2002

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com