Friday 25 November 2005 6:34:08 am
I encountered this "bug" with the undef operator. When I "undef" a variable previously declared with "def" i get a "undefined variable" error. Here is the scenario... I have "template1.tpl" like this:
{def $myvar=1}
{include uri='design:template2.tpl}
My variable in template1: {$myvar}
and "template2.tpl" like this:
My variable in template2: {$myvar}
{undef $myvar}
The output of this code is like this:
My variable in template2: 1
My variable in template1:
That's OK, since undef destroyed $myvar variable, but in the debug I get the following error:
Undefined Variable: $:myvar, cannot unset
I think that this error shouldn't happen because $myvar i defined, and also undef actually destroys it, so it's confusing, especially when you use it often.
--
Nothing is impossible. Not if you can imagine it!
Hubert Farnsworth
|