You need to add braces to multiline statements...
if(StructKeyExists(request.sessiondata,"username"))
{ // do nothing
foo = "true";
}
Else
{
StructInsert(request.sessiondata,"username","Neil
Robertson-Ravo","yes");
foo = "false";
}
HTH
-----Original Message-----
From: Robertson-Ravo, Neil (REC)
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 13, 2002 12:58
To: CF-Talk
Subject: RE: <cfscipt> IF
I also realise i have an overwrite flag.... just let that one go, I just
wanna know why it doesnt return TRUE ...?
-----Original Message-----
From: Robertson-Ravo, Neil (REC)
[mailto:[EMAIL PROTECTED]]
Sent: 13 August 2002 12:55
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
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
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