[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.html The 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 be good 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.=20 So, 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:

    
  1. [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.html The 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 be good 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.=20 So, 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:

normal users.db calls ... (1998) Forms Search Questions (1997) RE: Purchased cart being overwritten - still !?? (1997) Protect usage (1999) UPS online - Alaska and Hawaii (2003) Re:Help name our technology! (1997) Online reference (1997) select multiple (1997) E-mailer error codes (1997) Max Record length restated as maybe bug (1997) Fun with dates (1997) Re:Searching for ALL / empty form field (1997) f2 download problems (1997) Question about replacing words (1998) PCS Frames-Default page is solution! (1997) Search for starts with and ends with? (2003) Re:Realtime Transaction Processing (1999) Nested tags count question (1997) [recordrank]? (2000) WebCatalog can't find database (1997)