You can simply use IsDefined to check for the existence of a structure.
For example,
<cfif IsDefined("session.MyStruct")>
will result in TRUE if your structure exists in the session scope, and FALSE
if it does not exist.
You can also use the StructKeyExists() functions in some situations, for
example,
<cfif StructKeyExists(session, "MyStruct")>
will also result in TRUE if your structure exists in the session scope, and
FALSE if it doesn't.
Because StructKeyExists() will throw an error if the first structure
("session" in the above example) does not exist, I'd suggest that it's
generally safer to simply use IsDefined. Also check out the IsStruct() and
StructIsEmpty() functions for even better error checking. Using those you
can make sure that not only does session.MyStruct exist, but that it is in
fact a structure and that it contains keys.
Bob
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Alex Cianfarani
> Sent: Wednesday, 13 March 2002 7:11 a.m.
> To: CTalk
> Subject: [CFTALKTor] Checking for a structure
>
>
> Good day,
>
> I'm working on a site that uses structures. I store the
> structures for about
> 30 mins. I have forms that are set up in steps. What I need to do
> is if the
> 30 mins are expired...I need to check if my structures for my
> session vars
> have been created and if it is not to go back to the beginning of
> the steps
> for the forms.
>
> Thanks in advance.
>
> Alex Cianfarani
> _________________________
> Portfolio: www.acianfarani.ca
> Voice: 705.474.1785
>
>
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: "Alex Cianfarani"
> <[EMAIL PROTECTED]>
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED])
> http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)
>
>
-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Bob Silverberg" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)