On 10/11/01 11:38 PM, "Terry Steichen" <[EMAIL PROTECTED]> wrote:

> All,
> 
> I'm having trouble making some simple-looking VTL branching logic work.  It
> looks like this:
> 
> 1    #foreach($item in $items)
> 2        #set ($test = $item.Folder_code)
> 3        <td>$test</td>
> 4        #if($test == 0)
> 5            <td>file</td>
> 6        #else
> 7        <td>folder</td>
> 8        #end
> 9    #end
> 
> The value of $test that is printed is just fine (line 3 above) - but the
> branching logic
> (lines 4 through 8) doesn't work at all.
> 
> Now if I change the #set line to directly assign any number to $test (line 2)
> equent branching logic works just fine.  The problem seems to be in
> assigning $test the value of $item.Folder_code (line 2), which happens to be a
> byte.

A byte?  No, that won't work.  Integer comparisons only.

> 
> I went through the docs and the archives trying to figure this out.  Could
> any of you give me an idea on what the heck I'm doing wrong?
> 

Make folder code an integer, or add a little tool :

#if ($tool.eq( $item.Folder_code, 0 ) )

geir

-- 
Geir Magnusson Jr.     [EMAIL PROTECTED]
System and Software Consulting
"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety." - Benjamin Franklin


Reply via email to