RE: Second Pair Of Eyes

2004-09-01 Thread d.a.collie
dc said...
   Arguments is an array rather than a structure

 
dave watts said...
   If I recall correctly, the Arguments object is exposed
   as both an array
   and a structure.

 
s. isaac dealey said...
 On MX you're right, although the original question was on CF5. 

OK... run this code then

 
cfscript
function testArgs() {
 writeoutput(Args is Structure =   isStruct(arguments)  br /);
 writeoutput(Args is Array =   isArray(arguments)  br /);
}
testArgs(test1, test2, test3, test4);
/cfscript

 
.output is..
Args is Structure = NO
Args is Array = YES 

Therefore does that not mean that 'Arguments is an array rather than a
structure'?

 
I _am_ running it in CF5... don't know about CFMX.

 
Am I doing something wrong? 

 
-- 
dc
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Second Pair Of Eyes

2004-08-31 Thread Bert Dawson
in CF5 arguments is an array:

try: IsDefined(FORM.#ARGUMENTS[1]#)

I think that will work on MX too.

HTH
Bert

- Original Message -
From: Adrian Lynch [EMAIL PROTECTED]
Date: Tue, 31 Aug 2004 16:22:29 +0100
Subject: Second Pair Of Eyes
To: CF-Talk [EMAIL PROTECTED]

Can anyone see something wrong with this, working on CFMX but failing on CF5

 cfscript
 function formValue(formName, defaultValue) {

 if ( IsDefined(FORM.#ARGUMENTS.formName#) ) {
 return HTMLEditFormat(FORM[#ARGUMENTS.formName#]);
 } else {
 return HTMLEditFormat(ARGUMENTS.defaultValue);
 }

 }
 /cfscript

 Error resolving parameter ARGUMENTS.FORMNAME

 Is this ok on CF5..?

 IsDefined(FORM.#ARGUMENTS.formName#)

 What about...

 FORM[#ARGUMENTS.formName#]

 Thanks, just need someone else to look at it as it seems ok to me.

 Ade
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Second Pair Of Eyes

2004-08-31 Thread Ray Champagne
You don't need the #'s inthe isDefined - just the FORM.whatever variable.

I don't have a means to test this right now, but this jumped out at me.

Rau

At 11:22 AM 8/31/2004, you wrote:
Can anyone see something wrong with this, working on CFMX but failing on CF5

cfscript
function formValue(formName, defaultValue) {

if ( IsDefined(FORM.#ARGUMENTS.formName#) ) {
return HTMLEditFormat(FORM[#ARGUMENTS.formName#]);
} else {
return HTMLEditFormat(ARGUMENTS.defaultValue);
}

}
/cfscript

Error resolving parameter ARGUMENTS.FORMNAME


Is this ok on CF5..?

IsDefined(FORM.#ARGUMENTS.formName#)

What about...

FORM[#ARGUMENTS.formName#]

Thanks, just need someone else to look at it as it seems ok to me.

Ade




 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Second Pair Of Eyes

2004-08-31 Thread Qasim Rasheed
Have you tried usinge structkeyexits() instead of isDefined()

- Original Message -
From: Adrian Lynch [EMAIL PROTECTED]
Date: Tue, 31 Aug 2004 16:22:29 +0100
Subject: Second Pair Of Eyes
To: CF-Talk [EMAIL PROTECTED]

Can anyone see something wrong with this, working on CFMX but failing on CF5

cfscript
function formValue(formName, defaultValue) {

if ( IsDefined(FORM.#ARGUMENTS.formName#) ) {
return HTMLEditFormat(FORM[#ARGUMENTS.formName#]);
} else {
return HTMLEditFormat(ARGUMENTS.defaultValue);
}

}
/cfscript

Error resolving parameter ARGUMENTS.FORMNAME

Is this ok on CF5..?

IsDefined(FORM.#ARGUMENTS.formName#)

What about...

FORM[#ARGUMENTS.formName#]

Thanks, just need someone else to look at it as it seems ok to me.

Ade
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: Second Pair Of Eyes

2004-08-31 Thread d.a.collie
This works on CF5

 
cfset form.test = david

 
cfscript
function formValue(formName, defaultValue) {
if (structKeyExists(FORM, formName) ) {
 return HTMLEditFormat(FORM[formName]);
} else {
 return HTMLEditFormat(defaultValue);
}
}
/cfscript

 
cfdump var=#formValue(test,jimmy)#br /
cfdump var=#formValue(test2,jimmy)# 

 
Arguments is an array rather than a structure

 
-- 
dc
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: Second Pair Of Eyes

2004-08-31 Thread Adrian Lynch
Thanks Rau, the # are to evaluate ARGUMENTS.formName so it becomes
IsDefined(FORM.aNamePassedIn).

Thanks Bert, I thought it might be something like that.

Cheers

Ade

-Original Message-
From: Ray Champagne [mailto:[EMAIL PROTECTED]
Sent: 31 August 2004 16:31
To: CF-Talk
Subject: Re: Second Pair Of Eyes

You don't need the #'s inthe isDefined - just the FORM.whatever variable.

I don't have a means to test this right now, but this jumped out at me.

Rau

At 11:22 AM 8/31/2004, you wrote:
Can anyone see something wrong with this, working on CFMX but failing on
CF5

cfscript
function formValue(formName, defaultValue) {

if ( IsDefined(FORM.#ARGUMENTS.formName#) ) {
return HTMLEditFormat(FORM[#ARGUMENTS.formName#]);
} else {
return HTMLEditFormat(ARGUMENTS.defaultValue);
}

}
/cfscript

Error resolving parameter ARGUMENTS.FORMNAME


Is this ok on CF5..?

IsDefined(FORM.#ARGUMENTS.formName#)

What about...

FORM[#ARGUMENTS.formName#]

Thanks, just need someone else to look at it as it seems ok to me.

Ade




 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Second Pair Of Eyes

2004-08-31 Thread S . Isaac Dealey
He does if the the form element he's looking for is named by an
argument in his function, i.e. getFormElement(myform) - if this
function does anything with the value of form.myform, then he does
need the #'s.

Although I tend to use structkeyexists() for this. In which case there
wouldn't be #'s... structkeyexists(form,arguments[1]) -- although in
CF5 it does have to be a number, since it's an array, not an object
which sometimes but not always behaves like a structure and an array.
This was a peeve with MX for me -- it actually eliminated some
functionality that had existed before.

 You don't need the #'s inthe isDefined - just the
 FORM.whatever variable.

 I don't have a means to test this right now, but this
 jumped out at me.

 Rau

 At 11:22 AM 8/31/2004, you wrote:
Can anyone see something wrong with this, working on CFMX
but failing on CF5

cfscript
function formValue(formName, defaultValue) {

if ( IsDefined(FORM.#ARGUMENTS.formName#) ) {
return HTMLEditFormat(FORM[#ARGUMENTS.fo
rmName#]);
} else {
return
HTMLEditFormat(ARGUMENTS.defaultValue);
}

}
/cfscript

Error resolving parameter ARGUMENTS.FORMNAME


Is this ok on CF5..?

IsDefined(FORM.#ARGUMENTS.formName#)

What about...

FORM[#ARGUMENTS.formName#]

Thanks, just need someone else to look at it as it seems
ok to me.

Ade

s. isaac dealey954.927.5117

new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework
http://www.sys-con.com/story/?storyid=44477DE=1
http://www.sys-con.com/story/?storyid=45569DE=1
http://www.fusiontap.com
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: Second Pair Of Eyes

2004-08-31 Thread Gavin Brook
It also works fine on MX.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 31 August 2004 16:46
To: CF-Talk
Subject: RE: Second Pair Of Eyes

This works on CF5

cfset form.test = david

cfscript
function formValue(formName, defaultValue) {
if (structKeyExists(FORM, formName) ) {
 return HTMLEditFormat(FORM[formName]);
} else {
 return HTMLEditFormat(defaultValue);
}
}
/cfscript

cfdump var=#formValue(test,jimmy)#br /
cfdump var=#formValue(test2,jimmy)# 

Arguments is an array rather than a structure

-- 
dc 
_
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: Second Pair Of Eyes

2004-08-31 Thread Pascal Peters
In cf5, arguments is an array. Just use formName and defaultValue
without a prefix (or arguments[1] and arguments[2]).

Pascal

 -Original Message-
 From: Adrian Lynch [mailto:[EMAIL PROTECTED]
 Sent: 31 August 2004 17:22
 To: CF-Talk
 Subject: [Spam?] Second Pair Of Eyes
 
 Can anyone see something wrong with this, working on CFMX but failing
on
 CF5
 
 cfscript
 function formValue(formName, defaultValue) {
 
 	if ( IsDefined(FORM.#ARGUMENTS.formName#) ) {
 		return HTMLEditFormat(FORM[#ARGUMENTS.formName#]);
 	} else {
 		return HTMLEditFormat(ARGUMENTS.defaultValue);
 	}
 
 }
 /cfscript
 
 Error resolving parameter ARGUMENTS.FORMNAME
 
 
 Is this ok on CF5..?
 
 	IsDefined(FORM.#ARGUMENTS.formName#)
 
 What about...
 
 	FORM[#ARGUMENTS.formName#]
 
 Thanks, just need someone else to look at it as it seems ok to me.
 
 Ade
 
 
 

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: Second Pair Of Eyes

2004-08-31 Thread Dave Watts
 Arguments is an array rather than a structure

If I recall correctly, the Arguments object is exposed as both an array
and a structure.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: Second Pair Of Eyes

2004-08-31 Thread Pascal Peters
Not in CF5. That is where the problem was.

Pascal

 -Original Message-
 From: Dave Watts [mailto:[EMAIL PROTECTED]
 Sent: 31 August 2004 18:40
 To: CF-Talk
 Subject: [Spam?] RE: Second Pair Of Eyes
 
  Arguments is an array rather than a structure
 
 If I recall correctly, the Arguments object is exposed as both an
array
 and a structure.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 phone: 202-797-5496
 fax: 202-797-5444
 

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: Second Pair Of Eyes

2004-08-31 Thread S . Isaac Dealey
 Arguments is an array rather than a structure

 If I recall correctly, the Arguments object is exposed
 as both an array
 and a structure.

 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 phone: 202-797-5496
 fax: 202-797-5444

On MX you're right, although the original question was on CF5.

s. isaac dealey954.927.5117

new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework
http://www.sys-con.com/story/?storyid=44477DE=1
http://www.sys-con.com/story/?storyid=45569DE=1
http://www.fusiontap.com
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]