Does StructClear reset keys in a structure to be blank, or does it remove
the keys? Also, what's a function to get rid of a structure altogether?
Thank you
--
Archives: http://www.mail-archive.com/cf
I thought I had read that this line of code no longer works well in 4.5, is
this true?
Is there a better alternative? Should I be surrounding this with ?
Won Lee
Systems Consultant
New Channel Technologies
(330) 220-1558
[EMAIL PROTECTED]
"Turning ideas into e-Business"
Premier Partner
StructClear destroys struct keys. As for deleting structures altogether,
I'm not sure. Surely there's got to be a way to unset variables, right?
--
Jamie Keane
Programmer
SolutionMasters, Inc.
9111 Monroe Rd., Suite 100
Charlotte, NC 28270
www.solutionmasters.com
704.563.5559 x
> Does StructClear reset keys in a structure to be blank, or
> does it remove the keys?
It removes keys and values.
> Also, what's a function to get rid of a structure altogether?
I don't think there is one. You could overwrite a structure with a simple
value:
...
One
Stas-
The StructClear() function completely empties a structure; keys and
everything. Let's extend this for a second. Take the following situation:
A structure with 2 keys, right? Now, you can clear this structure one of
two ways:
There is an important distin
StructDelete(structure, key) :)
If you wanted to clear the structe you COULD
And you are left with a mere shell of
the structure you once had :)
Or you can use StructClear which clears
out the *data* only.
Jeremy
-Original Message-
From: Jamie Keane [mailto:[EMAIL
Not quite true. Just ran a test and StructClear deletes the keys just like
your loop does. Here is code you stick on any template to try:
<CFSET myStruct = StructNew()>
<CFSET myStruct.data = "somedata">
alert("#IsDefined('myStruct.data')#");
<C
Quarter Here >[ ]<
-Original Message-
From: Rick Osborne [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 01, 2000 12:56 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: StructClear
Stas-
The StructClear() function completely empties a structure; keys and
ever
> StructDelete(structure, key) :)
>
> If you wanted to clear the structe you COULD
>
>
>
>
>
> And you are left with a mere shell of
> the structure you once had :)
>
> Or you can use StructClear which clears
> out the *data* only.
Loopi
This is not true. :) The StructClear() function does the exact same thing
your loop does - it completely empties the structure of both keys and values
(data). Don't believe me? Try it:
#StructCount(Bag)#
#StructCount(Bag)#
You will get the following result:
100
0
Just 'cause I'm on a run of disagreeing with Jeremy today ... ;)
Jeremy Allen said:
>Since one object merely references something else and does nto
>actually copy the data and get its own set of data
>So, this opens up some interesting possibilities.
>Namely custom data structures among other thi
After I do a
StructClear(Session)
the Session.URLToken that I have added to links also get cleared out and I
get a message that Session.URLToken can't be found. How do I prevent it from
doing it that?
Thanks
Seba
It works, but too well. It also clears out session vars that ColdFusion uses
to track you. You should either use StructDelete to remove individual
variables, or simply store all of your stuff in a substructure, like
Session.MyVars. Then you can call StructClear on that structure w/o any
worries
3, 2000 11:14 AM
To: [EMAIL PROTECTED]
Subject: RE: structclear
It works, but too well. It also clears out session vars that ColdFusion uses
to track you. You should either use StructDelete to remove individual
variables, or simply store all of your stuff in a substructure, like
Session.MyVars. Th
ilto:[EMAIL PROTECTED]]
> Sent: Monday, April 03, 2000 11:49 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: structclear
>
>
> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
>
> --
[mailto:[EMAIL PROTECTED]]
Sent: Monday, April 03, 2000 10:31 AM
To: [EMAIL PROTECTED]
Subject: RE: structclear
It will not clear client vars, that's a different scope. And yes, you should
use CFLOCK in the case I described below. To be 100% safe, you
should -always- use C
> Could you enhance upon why you need to use cflock? Thanks!
Any time you read or write to memory variables (session, application,
server) you should use CFLOCK. If you're using CF 4.5, you should use the
SCOPE attribute in your CFLOCK tag, otherwise use the NAME attribute.
If you don't, you ri
>Could you enhance upon why you need to use cflock? Thanks!
I have forwarded to Michael a series of posts made to the Fusebox list some
time ago about locking access to shared variable access.
If anyone else is interested just let me know.
You may also want to look at
http://www.allaire.com/H
Douglas said:
One thing to note, is that with structClear() you will be
killing all session vars and not just the user that logged out.
I just checked, and in my app at least, this is not true. I use
StructClear(session) to log folks out and it works just fine. I just tried
logging in as two
You can't if unless you move that variables content into another scope
-Original Message-
From: sebastian palmigiani [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 11:01 PM
To: CF-Talk
Subject: StructClear(session)
After I do a
StructClear(Session)
the Session.URLToken
On 4/8/02, sebastian palmigiani penned:
>After I do a
>
>StructClear(Session)
>
>the Session.URLToken that I have added to links also get cleared out and I
>get a message that Session.URLToken can't be found. How do I prevent it from
>doing it that?
If you only have
Hi,
Recently someone said that StructClear(session) was a bad way to remove
session variables. Why? If I effectively want to remove an entire session
(this is ti be used in a logout template), wouldn't StructClear(Session) be
the way to do it?
Regards
Tage Widsell
Webmaster
Propelle
I actually just needed to delete a structure, so I read up a little and
tried out some cfdumps, and according to Jedi Master Forta (Web Application
Construction Kit, 4th Ed), StructClear just erases the current user's
session (and everything in it.) It doesn't erase all session variab
> Douglas said:
> One thing to note, is that with structClear() you will be
> killing all session vars and not just the user that logged out.
> I just checked, and in my app at least, this is not true.
I believe that it will not clear out the CFIF and CFToken in versions 4.x
but w
> > Douglas said:
> > One thing to note, is that with structClear() you will be
> > killing all session vars and not just the user that logged out.
> > I just checked, and in my app at least, this is not true.
> I believe that it will not clear out the CFIF and CF
What type of lock is used with StructClear(Session)? Is it ReadOnly or
Exclusive?
Sebastian
~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail
Tage,
If you run a the StructClear() against the session scope
you will lose ALL the session keys, including the session
ID, CFID and CFTOKEN. Once these are gone, it is impossible
to then associate a user with a session.
Good luck,
Beau
-Original Message-
From: Tage Widsell [mailto
structClear(session.loggedIn,username) would be a better alternative.
Db
- Original Message -
From: "Beau Harbin" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, November 13, 2001 5:00 AM
Subject: RE: StructClear(session) again...
ginal Message -
From: "Douglas L. Brown" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, November 13, 2001 7:57 AM
Subject: Re: StructClear(session) again...
structClear(session.loggedIn,username)
cust_login
WHERE username = '#userName#'
AND password = '#password#'
- Original Message -
From: "Matt Robertson" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, November 13, 2001 9:58 AM
Subject: Re: Struc
DOH!
I define the structure. duh. Thanks for the pointer ;D
--Matt--
- Original Message -
From: "Douglas L. Brown" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, November 13, 2001 10:24 AM
Subject: Re: StructClear(session) again.
Using StructClear(session) clears out the entire session scope, including sessionID,
CFID & CFTOKEN - if this is what you want, great.
It's important to use StructClear(session.structName) if you want to clear only a
single structure in the session scope.
Chris Norloff
--
I have written an application that allows a user to log in.
When the user logs in I run the following code...
I first check to see if the user exisits. If so...
Then I set some session variables
self.location ='https://foo';
return them to the home page
EXCLUSIVE
At 04:42 PM 4/19/01 -0500, you wrote:
>What type of lock is used with StructClear(Session)? Is it ReadOnly or
>Exclusive?
>
>Sebastian
>
>
>
~~
Structure your ColdFusion code with Fusebox. Get the o
EMAIL PROTECTED]
Sent: zondag 16 november 2003 16:42
To: CF-Talk
Subject: HELP - Logout (sessionDelete, StructClear)?
I have written an application that allows a user to log in.
When the user logs in I run the following code...
I first check to see if the user exisits. If so...
35 matches
Mail list logo