Adam is right

if your going to do that you would have to do this

<cfset OrganisationNameSearch = 
evaluate("new('class.asic.message.OrganisationNameRequestMessage').init(organisationName
 = iif(1=1,
de("'Shelco'"), de(''))))>

use the IIF to set the value rather than trying to create the whole string

Steve

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adam Cameron
Sent: Monday, June 13, 2005 9:35 PM
To: CFAussie Mailing List
Subject: [cfaussie] Re: conditional arguments

>> OrganisationNameSearch = new
>> ( "class.asic.message.OrganisationNameRequestMessage" ).init( if( 1=1 ) 
>> {organisationName = 'Shelco'} );

I don't really think that makes sense.

>  I know you can use IIF() with arguments in cf tags, but not in methods 
> appearently..

The CFML-version of what you're attempting to do above is kinda like this:

<cfinvoke component="class.asic.message.OrganisationNameRequestMessage"
method="init" #iif(1=1, dE( "organisationName = 'Shelco'" ), dE("") ))#
returnvariable="OrganisationNameSearch">

And obviously you'd not expect that to work, would you?

You cannot use CF statements to build other CFML statements.

However, you could (if you REALLY wanted to) do this:

<cfset OrganisationNameSearch =
evaluate("new('class.asic.message.OrganisationNameRequestMessage').init(        
iif(1=1, de(""organisationName = 'Shelco'""), de('')))")>

But... err... yeah.  I probably wouldn't ever do that ;-)

-- 

Adam

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/


---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to