[AWS] Templates Parser Crash Again

Pascal Obry p.obry@wanadoo.fr
Sat, 24 Nov 2001 09:01:53 +0100


Al Christians writes:
 > I've got a line (line 19) in a template that looks like this:
 > 
 > 
 >     @@IF@@ @_SectionNo_@ > 0
 > 
 > If there are spaces on this line after the 0, I get:
 > 
 > 
 > In J:XXXXXx.thtml at line 19 condition, unknown 
 > operator .
 > Exception name: TEMPLATES_PARSER.TEMPLATE_ERROR

It was a bug in the parsing. This is now fixed and I will distribute a new
version later today on my homepage.

 > I'm not sure if this might somehow be caused by the oddball format
 > of the value in the SectionNo value.  The SectionNo vareiable has been 
 > assigned a string value = "0_1";  I don't care if the templates parser
 > evaluates this as a string or as a number, the condition should be true
 > either way, right?  I guess I'd rather have it evaluated as a string.
 > Does changing the 0 to "0" accomplish that?  This example crashes 
 > either way if the line has trailing blanks. 

The rule (as explain in the documentation) is to first try to compare both
sides of operator as numbers and if it fails the comparison is done with the
string representation.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"