Thanks everyone, sorted now..... <blush/>




N



-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]]
Sent: 13 August 2002 13:14
To: CF-Talk
Subject: RE: <cfscipt> IF


It's because you aren't using brackets. Let me rewrite your code:

if(structKe.......) foo = "true";
else structInsiert(...);
foo = false;

See how the last foo = false is always going to be run? To fix, change
it to:

if(structKe.......) foo = "true";
else {
        structInsiert(...);
        foo = false;
        }


=======================================================================
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email    : [EMAIL PROTECTED]
Yahoo IM : cfjedimaster

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

> -----Original Message-----
> From: Robertson-Ravo, Neil (REC) 
> [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, August 13, 2002 7:55 AM
> To: CF-Talk
> Subject: <cfscipt> IF
> 
> 
> I have a structure with key "username",  I am trying to use 
> the following
> code to evaluate it : 
> 
> if(StructKeyExists(request.sessiondata,"username"))
>       // do nothing                   
>       foo = "true";
> else
>       StructInsert(request.sessiondata,"username","Neil
> Robertson-Ravo","yes");
> foo = "false";
> 
> 
> This ALWAYS seems to return false, even though the code below 
> returns TRUE
> 
> <cfif StructKeyExists(request.sessiondata,"username")>
>       TRUE
>       <cfelse>
>       FALSE
> </cfif>
> 
> Anyone?  its probably just a brainfart as usual but I can see 
> why it doesnt
> work as intended?
> 
> Neil
> 

______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to