[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:
Resume Catalog ? (1997)
WebCat2b12 CGI Mac -- Problems propagating the cart through frames...still (1997)
[WebDNA] anyone successfully using webdna with paypal's NVP API? (2008)
default error on NT? (1997)
WebCat2.0 [format thousands .0f] no go (1997)
Possible Bug in 2.0b15.acgi (1997)
Using [Include] Context (1999)
Password and Allow commands (1998)
WebDNA Solutions ... sorry! (1997)
Bug Report, maybe (1997)
Re:Can this be done? (1997)
WebCat Beta NT 18 (1997)
WebDNA for Dummies (2004)
One Hour Email (2002)
Webcat & SIMS (1998)
Help!HELP!HELP! (1999)
[addlineitems] as oppossed to url command=add (2000)
Changing price for a SLU based on options (size, etc.) (1997)
Doesn't change (WebCat 4.0) (2000)
cart info (1998)