[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:
Protect & InstantSSL (Fixed) (2003)
Grant, please help me ... (1997)
I'm new be kind (1997)
Emailer Problem (2000)
Email notification to one of multiple vendors ? (1997)
WebCat table size. (2001)
Country & Ship-to address & other fields ? (1997)
WC 2.0 frames feature (1997)
[WebDNA] [store] and [recall]: default db location (2015)
[search][founditems][orderfile] (2003)
WebCatalog [FoundItems] Problem - LONG - (1997)
questions on variations of Ken's [text multi=T]var1=&var2=[/text] (1999)
Problems getting parameters passed into email. (1997)
Stopping bad HTML propagation ? (1997)
WebCat2_Mac RETURNs in .db (1997)
[isfolder] and [filename] (1997)
Database Program (1997)
writefile and deletefile (1998)
Trailing carriage returns (2002)
Card clearance, problems - solutions? (1997)