[ic] Nested elsif bug still in 5.2

Sandy Thomson sandy at scotwebshops.com
Mon Jul 10 11:06:03 EDT 2006


Grant wrote:
> I've been dealing with a nested elsif bug for a while.  I first
> noticed it in 4.9.3:
>
> http://www.icdevgroup.org/pipermail/interchange-users/2003-September/035131.html
>
>
> and then in 5.0:
>
> http://www.icdevgroup.org/pipermail/interchange-users/2004-March/038202.html
>
>
> and now in 5.2.  Basically, nested elsif doesn't work when named
> parameters are used.  Here's an example:
>
> [tmpn name="test"]1[/tmpn]
> [if type="scratch" term="test" op="eq" compare="2"]
> INCORRECT
> [elsif type="scratch" term="test" op="eq" compare="1"]
>        [if type="scratch" term="test" op="eq" compare="2"]
> INCORRECT
>        [elsif type="scratch" term="test" op="eq" compare="1"]
> CORRECT
>        [/elsif]
>        [/if]
> [/elsif]
> [/if]
>
> The above works correctly when positional parameters are used instead
> of named.  Is this fixed in 5.4?

The following will work:

[tmpn name="test"]1[/tmpn]

[if term="[scratch test]" op="eq" compare="2"]
MOO
[elsif term="[scratch test]" op="eq" compare="1"]
       [if term="[scratch test]" op="eq" compare="2"]
       MOO2
       [elsif term="[scratch test]" op="eq" compare="1"]
       MOO3
       [/elsif]
       [/if]
[/elsif]
[/if]

Also note, if you are comparing numbers you might want to use an op of "==".

Cheers.

Sandy.


More information about the interchange-users mailing list