[WebDNA] scope for vars passed in includes
This WebDNA talk-list message is from 2015
It keeps the original formatting.
numero = 112431
interpreted = N
texte = Hello,This is meant to spark some discussion.. a bit technical question of =whether the include tag should be changed slightly.Here is my test page:http://www.euca.us/admin/tests/include-bug/test.htmlThe main issue for discussion is that when passing a variable in an =include:[include file=3Dsomefile.inc&var=3Dsomevalue]You can=92t overwrite the var value with a text context within =somefile.inc.=20 (I am guessing it is in a scope-preferred assignment... but haven=92t =looked that deeply yet... maybe this is documented somewhere=85 I don=92t =know.)Moreso, For me, i=92m wondering if it would be more intuitive if that =var only acted within the scope of that include file (level) only.For example in my test, there is an inc2.inc. Lets assume that in =inc1.inc that I don=92t actually try to reset var with 2. In that case, =it might begood if the value of var (within inc2.inc) is literally =91[var]=92, =(un-initialized).This question addresses encapsulation for the [include] tag I guess=85 =would we want it, or would we not=85 what are the ramifications, etc..=20=In my test, if we made the encapsulation change, the value of var within =inc2.inc would be =912=92, because I had set the text var above in the =hierarchy.=20So, two questions regarding the old [include] tag for discussion: 1.) Why can=92t or shouldn't a text var be able to override a passed =variable? 2.) What about the idea of encapsulation for the passed variables?Sincerely,Donovan
Associated Messages, from the most recent to the oldest:
|
- [WebDNA] scope for vars passed in includes (Donovan Brooke 2015)
|
Hello,This is meant to spark some discussion.. a bit technical question of =whether the include tag should be changed slightly.Here is my test page:http://www.euca.us/admin/tests/include-bug/test.htmlThe main issue for discussion is that when passing a variable in an =include:[include file=3Dsomefile.inc&var=3Dsomevalue]You can=92t overwrite the var value with a text context within =somefile.inc.=20 (I am guessing it is in a scope-preferred assignment... but haven=92t =looked that deeply yet... maybe this is documented somewhere=85 I don=92t =know.)Moreso, For me, i=92m wondering if it would be more intuitive if that =var only acted within the scope of that include file (level) only.For example in my test, there is an inc2.inc. Lets assume that in =inc1.inc that I don=92t actually try to reset var with 2. In that case, =it might begood if the value of var (within inc2.inc) is literally =91[var]=92, =(un-initialized).This question addresses encapsulation for the
[include] tag I guess=85 =would we want it, or would we not=85 what are the ramifications, etc..=20=In my test, if we made the encapsulation change, the value of var within =inc2.inc would be =912=92, because I had set the text var above in the =hierarchy.=20So, two questions regarding the old
[include] tag for discussion: 1.) Why can=92t or shouldn't a text var be able to override a passed =variable? 2.) What about the idea of encapsulation for the passed variables?Sincerely,Donovan
Donovan Brooke
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
triggers.db (1999)
WebCat2.0 [format thousands .0f] no go (1997)
WebCat2: Found Items syntax, etc. (1997)
emailer w/F2 (1997)
Unknown error: OrderNotCreated (1997)
Initiating NewCart (1997)
WC --> printer (1998)
To Err or Not Custom Error (1999)
A multi-processor savvy WebCatalog? (1997)
really wierd date stuff on NT (1997)
[sendmail] on NT? (1997)
SiteGuard Admin Feature ? (1997)
sandboxes with 6.0 (2004)
[WebDNA] Max upload file size (2010)
system crashes, event log (1997)
New Plug-in and Type 11 errors (1997)
RE: [WebDNA] Dead line Time Math (2017)
I'm new be kind (1997)
RE: [WebDNA] CSS HTML Email Using Emailer (2010)
Emailer (WebCat2) (1997)