RE: Conclusion? (RE: Attributes Scoped Structure?)
For the heck of it I submitted this as a 5.0 bug. It was assigned issue number 26171. I'll let the list know if anything comes up. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Conclusion? (RE: Attributes Scoped Structure?)
Brad- Maybe its a bug and maybe its just a bad error message. I came across this problem a while back when I had a student who was trying to build a system where some files could sometimes be called as a custom tag and sometimes as a plain template (about like you're doing). The behavior feels wrong. You've covered a lot of the same ground that I did when I the student (I wish I could remember his name) pointed it out. I'll reconstruct my tests (much of which review/echo what you've done): foo.cfm looks like this: If you call foo.cfm as a custom tag it will run fine. If you call foo.cfm directly it will throw the error you've already noted in this thread. Change foo.cfm to: #isStruct(ATTRIBUTES)# If you call foo.cfm as a custom tag it will return "YES". If you call foo.cfm directly it will throw variable not defined error. Now let's change foo.cfm to: If you call foo.cfm as a custom tag it will run fine. If you call foo.cfm directly it will run fine. Which leads us to the code-around for the problem: Which is uglier than it ought to be but does seem to work. It seems to me (but I may be wrong) that the explanation is that the ATTRIBUTES structure (scope) is automatically defined when a file is called as a custom tag but is not automatically defined when a file is called directly. Because ATTRIBUTES is not defined it would follow that you can not make one of its keys into a structure. (A conclusion you reached as well.) If that reasoning bears out this is just a confusing error message. To test our thinking make one more change to foo.cfm: #isStruct(ATTRIBUTES)# If our idea makes sense when we call the file as a custom tag we should get the "Cannot assign result to symbol cheese.y" and ... we do. So really (maybe) this is just a confusing error message. And, BTW, all of this seem to hold true on CF5.0 as well. The thing I haven't played with is the Array stuff. I will now- thanks for bringing it up. Craig Fisher Alta Interactive, Inc. http://www.altainteractive.com/ [EMAIL PROTECTED] 801-791-8251 -Original Message- From: Brad Roberts [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 24, 2001 3:45 PM To: CF-Talk Subject: Conclusion? (RE: Attributes Scoped Structure?) Okay, I think I'm getting somewhere. First, you can create an array in the attributes scope. The following works. - #arraylen(attributes.test)# - I created a custom tag called : - #IsStruct(attributes)# - When calling the custom tag above , the result is "yes". "Attributes" must be a default structure within a custom tag. I then changed to this: - #IsStruct(attributes.temp)# - Again, the result was "yes". So, why can you create an attributes scoped structure inside of a custom tag, but not in your normal template? I'm concluding that the attributes scope has to be a structure first, and then you can nest a structure inside it. The following works fine in a normal template: - #isstruct(attributes.test)# - Is this a bug? Anyone else have an opinion? Brad > -Original Message- > From: Howarth, Craig (IBK-NY) [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 24, 2001 2:20 PM > To: CF-Talk > Subject: RE: Attributes Scoped Structure? > > > This is interesting and I don't have an answer. Perhaps someone > else can explain this. > > The statement > > > > will fail as described below if placed in a standard template, > but works fine in a custom tag. This led to my response to Brad. > Not being a Fuseboxer, I should have experimented further. > > As Jason points out the following works fine in a standard template: > > > > Why the difference with assigning simple values to attributes > scope as opposed to structures? > > > -Original Message- > > From: Jason Lotz [SMTP:[EMAIL PROTECTED]] > > Sent: Thursday, May 24, 2001 11:58 AM > > To: CF-Talk > > Subject:Re: Attributes Scoped Structure? > > > > That's not true. Fusebox uses nothing but Attributes scoped > variables. You > > can set Attributes variables anywhere. > > > &
RE: Attributes Scoped Structure?
Cool, thanks Dave. I found out that it works inside a custom tag. I did a few tests, mentioned in my previous post, which hasn't shown up yet. The tests yielded some odd results. Has anyone tried it in CF5? Thanks again for the confirmation, Brad > -Original Message- > From: Dave Watts [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 24, 2001 6:00 PM > To: CF-Talk > Subject: RE: Attributes Scoped Structure? > > > > The statement > > > > > > > > will fail as described below if placed in a standard > > template, but works fine in a custom tag. This led to > > my response to Brad. Not being a Fuseboxer, I should > > have experimented further. > > > > As Jason points out the following works fine in a > > standard template: > > > > > > > > Why the difference with assigning simple values to > > attributes scope as opposed to structures? > > This is a known and documented bug. Unfortunately, I don't recall > where it's > documented. I learned about it from Craig Fisher, an Allaire > instructor, who > may have originally reported the bug. > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > voice: (202) 797-5496 > fax: (202) 797-5444 > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Attributes Scoped Structure?
> The statement > > > > will fail as described below if placed in a standard > template, but works fine in a custom tag. This led to > my response to Brad. Not being a Fuseboxer, I should > have experimented further. > > As Jason points out the following works fine in a > standard template: > > > > Why the difference with assigning simple values to > attributes scope as opposed to structures? This is a known and documented bug. Unfortunately, I don't recall where it's documented. I learned about it from Craig Fisher, an Allaire instructor, who may have originally reported the bug. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Conclusion? (RE: Attributes Scoped Structure?)
Okay, I think I'm getting somewhere. First, you can create an array in the attributes scope. The following works. - #arraylen(attributes.test)# - I created a custom tag called : - #IsStruct(attributes)# - When calling the custom tag above , the result is "yes". "Attributes" must be a default structure within a custom tag. I then changed to this: - #IsStruct(attributes.temp)# - Again, the result was "yes". So, why can you create an attributes scoped structure inside of a custom tag, but not in your normal template? I'm concluding that the attributes scope has to be a structure first, and then you can nest a structure inside it. The following works fine in a normal template: - #isstruct(attributes.test)# - Is this a bug? Anyone else have an opinion? Brad > -Original Message- > From: Howarth, Craig (IBK-NY) [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 24, 2001 2:20 PM > To: CF-Talk > Subject: RE: Attributes Scoped Structure? > > > This is interesting and I don't have an answer. Perhaps someone > else can explain this. > > The statement > > > > will fail as described below if placed in a standard template, > but works fine in a custom tag. This led to my response to Brad. > Not being a Fuseboxer, I should have experimented further. > > As Jason points out the following works fine in a standard template: > > > > Why the difference with assigning simple values to attributes > scope as opposed to structures? > > > -Original Message- > > From: Jason Lotz [SMTP:[EMAIL PROTECTED]] > > Sent: Thursday, May 24, 2001 11:58 AM > > To: CF-Talk > > Subject:Re: Attributes Scoped Structure? > > > > That's not true. Fusebox uses nothing but Attributes scoped > variables. You > > can set Attributes variables anywhere. > > > > ----- Original Message - > > From: "Howarth, Craig (IBK-NY)" <[EMAIL PROTECTED]> > > To: "CF-Talk" <[EMAIL PROTECTED]> > > Sent: Thursday, May 24, 2001 7:36 AM > > Subject: RE: Attributes Scoped Structure? > > > > > > Brad, > > > > The attributes scope can only be used within a custom tag. This is the > > error message that you get when you attempt to assign a value to the > > attributes scope in a normal template. > > > > Craig > > > > > -Original Message- > > > From: Brad Roberts [SMTP:[EMAIL PROTECTED]] > > > Sent: Thursday, May 24, 2001 9:55 AM > > > To: CF-Talk > > > Subject: Attributes Scoped Structure? > > > > > > Can you set a structure in the attributes scope? > > > > > > I'm wondering why this isn't working: > > > > > > > > > > > > I get the following error: > > > Cannot assign result to symbol attributes.temp > > > > > > Thanks in advance, > > > > > > Brad > > > > > > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Attributes Scoped Structure?
I'm kinda stumped on this. I'm going to try creating an attributes scoped array. The attributes scope should be able to handle complex variables just like the "variables" scope. Anyone else have an answer? The question is, Why can't you create an attributes scoped structure? doesn't work. You get the error: Cannot assign result to symbol attributes.temp > -Original Message- > From: Howarth, Craig (IBK-NY) [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 24, 2001 2:20 PM > To: CF-Talk > Subject: RE: Attributes Scoped Structure? > > > This is interesting and I don't have an answer. Perhaps someone > else can explain this. > > The statement > > > > will fail as described below if placed in a standard template, > but works fine in a custom tag. This led to my response to Brad. > Not being a Fuseboxer, I should have experimented further. > > As Jason points out the following works fine in a standard template: > > > > Why the difference with assigning simple values to attributes > scope as opposed to structures? > > > -Original Message- > > From: Jason Lotz [SMTP:[EMAIL PROTECTED]] > > Sent: Thursday, May 24, 2001 11:58 AM > > To: CF-Talk > > Subject:Re: Attributes Scoped Structure? > > > > That's not true. Fusebox uses nothing but Attributes scoped > variables. You > > can set Attributes variables anywhere. > > > > ----- Original Message - > > From: "Howarth, Craig (IBK-NY)" <[EMAIL PROTECTED]> > > To: "CF-Talk" <[EMAIL PROTECTED]> > > Sent: Thursday, May 24, 2001 7:36 AM > > Subject: RE: Attributes Scoped Structure? > > > > > > Brad, > > > > The attributes scope can only be used within a custom tag. This is the > > error message that you get when you attempt to assign a value to the > > attributes scope in a normal template. > > > > Craig > > > > > -Original Message- > > > From: Brad Roberts [SMTP:[EMAIL PROTECTED]] > > > Sent: Thursday, May 24, 2001 9:55 AM > > > To: CF-Talk > > > Subject: Attributes Scoped Structure? > > > > > > Can you set a structure in the attributes scope? > > > > > > I'm wondering why this isn't working: > > > > > > > > > > > > I get the following error: > > > Cannot assign result to symbol attributes.temp > > > > > > Thanks in advance, > > > > > > Brad > > > > > > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Attributes Scoped Structure?
This is interesting and I don't have an answer. Perhaps someone else can explain this. The statement will fail as described below if placed in a standard template, but works fine in a custom tag. This led to my response to Brad. Not being a Fuseboxer, I should have experimented further. As Jason points out the following works fine in a standard template: Why the difference with assigning simple values to attributes scope as opposed to structures? > -Original Message- > From: Jason Lotz [SMTP:[EMAIL PROTECTED]] > Sent: Thursday, May 24, 2001 11:58 AM > To: CF-Talk > Subject: Re: Attributes Scoped Structure? > > That's not true. Fusebox uses nothing but Attributes scoped variables. You > can set Attributes variables anywhere. > > - Original Message - > From: "Howarth, Craig (IBK-NY)" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Thursday, May 24, 2001 7:36 AM > Subject: RE: Attributes Scoped Structure? > > > Brad, > > The attributes scope can only be used within a custom tag. This is the > error message that you get when you attempt to assign a value to the > attributes scope in a normal template. > > Craig > > > -Original Message- > > From: Brad Roberts [SMTP:[EMAIL PROTECTED]] > > Sent: Thursday, May 24, 2001 9:55 AM > > To: CF-Talk > > Subject: Attributes Scoped Structure? > > > > Can you set a structure in the attributes scope? > > > > I'm wondering why this isn't working: > > > > > > > > I get the following error: > > Cannot assign result to symbol attributes.temp > > > > Thanks in advance, > > > > Brad > > > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Attributes Scoped Structure?
That's not true. Fusebox uses nothing but Attributes scoped variables. You can set Attributes variables anywhere. - Original Message - From: "Howarth, Craig (IBK-NY)" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, May 24, 2001 7:36 AM Subject: RE: Attributes Scoped Structure? Brad, The attributes scope can only be used within a custom tag. This is the error message that you get when you attempt to assign a value to the attributes scope in a normal template. Craig > -Original Message- > From: Brad Roberts [SMTP:[EMAIL PROTECTED]] > Sent: Thursday, May 24, 2001 9:55 AM > To: CF-Talk > Subject: Attributes Scoped Structure? > > Can you set a structure in the attributes scope? > > I'm wondering why this isn't working: > > > > I get the following error: > Cannot assign result to symbol attributes.temp > > Thanks in advance, > > Brad > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Attributes Scoped Structure?
Not sure Brad, but if you're trying to have the struct accessible in a custom tag, you could maybe use, Regards, Craig. -Original Message- From: Brad Roberts [mailto:[EMAIL PROTECTED]] Sent: 24 May 2001 14:55 To: CF-Talk Subject: Attributes Scoped Structure? Can you set a structure in the attributes scope? I'm wondering why this isn't working: I get the following error: Cannot assign result to symbol attributes.temp Thanks in advance, Brad ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Attributes Scoped Structure?
Brad, The attributes scope can only be used within a custom tag. This is the error message that you get when you attempt to assign a value to the attributes scope in a normal template. Craig > -Original Message- > From: Brad Roberts [SMTP:[EMAIL PROTECTED]] > Sent: Thursday, May 24, 2001 9:55 AM > To: CF-Talk > Subject: Attributes Scoped Structure? > > Can you set a structure in the attributes scope? > > I'm wondering why this isn't working: > > > > I get the following error: > Cannot assign result to symbol attributes.temp > > Thanks in advance, > > Brad > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists