Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Variables not resetting on each request
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alex Skinner  
View profile  
 More options Apr 5 2012, 2:47 pm
From: Alex Skinner <a...@pixl8.co.uk>
Date: Thu, 5 Apr 2012 19:47:24 +0100
Local: Thurs, Apr 5 2012 2:47 pm
Subject: Re: [OpenBD] Variables not resetting on each request

No because they need to be varred.

On Thursday, 5 April 2012, Benjamin Davis <benthecomputer...@gmail.com>
wrote:

> Thanks Alan!
> I see what part of the problem here is.  When you dumped the variables on

the index page, it is coming through the call of the scanner.LoadTemplate,
which has access to the full cfc.  So, to test this.  I created another
function in the scanner.cfc which just returned "Hi" and then I called it
from the index.cfm page with <cfoutput>#testing()#</cfoutput> and I get
"Hi" on my page, so the index.cfm has full access to the scanner.cfc......
> I guess that I'm going to have to think this through a little bit more

and come up with a better solution.
> The strange thing still though, is that shouldn't each call to the

function reset its local variables?  For example, if I do a dump of the
variables scope inside of my LoadTemplate function, each call to the
function has the exact same variables.  Shouldn't this be reset with each
call?
> Thanks for the name info.  I didn't realize that I had done that as I was

throwing this together.

> On Tue, Apr 3, 2012 at 9:29 PM, Alan Holden <alhol...@akh.com> wrote:

> It would be nice if we could post the salient parts of this code right in

the mailing list, if you don't mind. You might get a broader response that
way.

> NOTE: I get the same results from ACF9 as from OpenBD 2.02...  G G G

Ghost Vars!! RUN! AAAAyyyyeeeeee!!

> I put this line <cfdump var="#variables#"> at the end of your index.cfm

file, and I can see all the things that CF considers "un-scoped".  For
example, while you DO scope application.Scanner on startup, this object has
2 methods within (LoadTemplate & LoadPage) that have popped up in the
"variables" scope at the time the dump is called.

> I think the issue might come from using the OnRequest() method as the

"code shell" for the whole page; also perhaps that the methods in
scanner.cfc are not well encapsulated. They read from external scopes and
write directly to the page, as opposed to [returning values back - from
input arguments passed in], like most well-behaved functions.

> Here are some quasi-related conversations I found - that might help:
> http://forums.adobe.com/message/2285269

http://stackoverflow.com/questions/8188015/do-variables-inside-applic...
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=app...

> Finally, your application is named "Scanner", and you've also created an

object named "Scanner" within it. Despite the referential separation by
tiny dots, some people would cringe and shudder at such a naming practice.

> Al

> On 4/3/2012 8:29 AM, Benjamin Davis wrote:

> Hey Alan,
> Thanks for the info.  Attached is a zip file with the basic of basics.

 In this example, the index.cfm file sets a variable and then when you to
go page2.cfm, the variable is displayed, even though that page never
specifically sets the variable.  Let me know what you think.
> Thanks!
> Ben

> On Mon, Apr 2, 2012 at 5:54 PM, Alan Holden <alhol...@akh.com> wrote:

> It certainly seems like something (perhaps that function) is definitely

causing the variables scope to go zombie on you. But you may need to
whittle your code down to a core sample and actually post that - to get the
greatest qty of help.

> Alan Holden
> (at work)

> On 4/2/2012 2:35 PM, Ben wrote:

> So, I have an interesting case that needs some external thought.  I've

created a "framework" that handles all of my security as well as combining
the page that is requested into a template file.  I've made this into a cfc
that is loaded into the Application Scope.  In my OnRequest function, I
call another function of my framework that loads any external files, the
requested file, and then the template file where everything gets combined.
 This has been working great, but then I realized that if I set a new
variable on one page I can output it on another page even though I haven't
declare it on the second

--
Alex Skinner
Managing Director
Pixl8 Interactive

Tel: +448452600726
Email: a...@pixl8.co.uk
Web: pixl8.co.uk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.