Re: Using Iif and De together...

2006-12-07 Thread JediHomer
IIf(StructKeyExists(FORM, listing_openhouse),
'Trim(FORM.listing_openhouse)', 'N')

*should* do it :)


On 07/12/06, Andy Matthews [EMAIL PROTECTED] wrote:
 I KNOW that I've used this method successfully before, but for some reason
 it's not working correctly now.

 I've got a radio button in a form. I want to make sure that button is there,
 and if so use it's value. It it's not there then I want the string N:

 IIf(NOT
 StructKeyExists(FORM,listing_openhouse),Trim(FORM.listing_openhouse),De(N
 ))

 I'm using this so that I can put it on one line. It's more cosmetic than
 necessary, but it should be working and I'm not sure why it isn't.

 Anyone have any ideas?

 !//--
 andy matthews
 web developer
 certified advanced coldfusion programmer
 ICGLink, Inc.
 [EMAIL PROTECTED]
 615.370.1530 x737
 --//-


 

~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:263161
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Using Iif and De together...

2006-12-07 Thread Michael Dinowitz
Two points. The first is that any variable or function used in the last 2 
arguments will be evaluated both before and after the tag runs and DE is used 
only to quote a variable/function rather than forcing the programmer to do it 
themselves.
That being said, the problem is probably in your second argument. Before the 
function is processed, the trim function will run and the 
Trim(FORM.listing_openhouse) will be replaced with text. If this is 'true' then 
the result of the trim will be treated as a variable, not as a value. I'd 
rewrite the function as:
IIf(NOT StructKeyExists(FORM, 'listing_openhouse'), 
'Trim(FORM.listing_openhouse)', 'N')

The second argument is escaped and will only be evaluated if it is 'true'. The 
third argument is double escaped which is exactly what De would do for you.
This should work for you.

I KNOW that I've used this method successfully before, but for some reason
it's not working correctly now.

I've got a radio button in a form. I want to make sure that button is there,
and if so use it's value. It it's not there then I want the string N:

IIf(NOT
StructKeyExists(FORM,listing_openhouse),Trim(FORM.listing_openhouse),De(N
))

I'm using this so that I can put it on one line. It's more cosmetic than
necessary, but it should be working and I'm not sure why it isn't.

Anyone have any ideas?

!//--
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--//-

~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:263162
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Using Iif and De together...

2006-12-07 Thread Andy Matthews
I think that's what I was missing guys. The extra set of quotes on the final
argument.

Thanks Michael and jedihomer

!//--
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--//-

-Original Message-
From: Michael Dinowitz [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 07, 2006 9:48 AM
To: CF-Talk
Subject: Re: Using Iif and De together...


Two points. The first is that any variable or function used in the last 2
arguments will be evaluated both before and after the tag runs and DE is
used only to quote a variable/function rather than forcing the programmer to
do it themselves.
That being said, the problem is probably in your second argument. Before the
function is processed, the trim function will run and the
Trim(FORM.listing_openhouse) will be replaced with text. If this is 'true'
then the result of the trim will be treated as a variable, not as a value.
I'd rewrite the function as:
IIf(NOT StructKeyExists(FORM, 'listing_openhouse'),
'Trim(FORM.listing_openhouse)', 'N')

The second argument is escaped and will only be evaluated if it is 'true'.
The third argument is double escaped which is exactly what De would do for
you.
This should work for you.

I KNOW that I've used this method successfully before, but for some reason
it's not working correctly now.

I've got a radio button in a form. I want to make sure that button is
there,
and if so use it's value. It it's not there then I want the string N:

IIf(NOT
StructKeyExists(FORM,listing_openhouse),Trim(FORM.listing_openhouse),De(
N
))

I'm using this so that I can put it on one line. It's more cosmetic than
necessary, but it should be working and I'm not sure why it isn't.

Anyone have any ideas?

!//--
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--//-



~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:263164
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Using Iif and De together...

2006-12-07 Thread Bobby Hartsfield
Couldn’t you just use:

cfparam name=form.listing_openhouse default=N /

If it already exists, its value will be in form.listing_openhouse
If it DOES not exist, it will be created and the value N will be stored in
it.

..:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 

 


-Original Message-
From: Andy Matthews [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 07, 2006 11:49 AM
To: CF-Talk
Subject: Using Iif and De together...

I KNOW that I've used this method successfully before, but for some reason
it's not working correctly now.

I've got a radio button in a form. I want to make sure that button is there,
and if so use it's value. It it's not there then I want the string N:

IIf(NOT
StructKeyExists(FORM,listing_openhouse),Trim(FORM.listing_openhouse),De(N
))

I'm using this so that I can put it on one line. It's more cosmetic than
necessary, but it should be working and I'm not sure why it isn't.

Anyone have any ideas?

!//--
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--//-




~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:263217
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4