[ic] If Else Statement

Grant listbox at email.com
Mon Oct 13 16:22:43 EDT 2003


> > > I would not recommend doing the following in an iterative
> list (like the
> > > results.html page, for instance), but if this is just a one-off
> > > thing, like
> > > on flypage.html, you can do:
> > >
> > > [tmp field_contents][item-field category][/tmp]
> > >
> > > [if scratch field_contents eq schwinn]
> > > ...
> > > [elsif scratch field_contents eq mongoose]
> > > ...
> > > [/elsif]
> > > [elsif scratch field_contents eq something_else]
> > > ...
> > > [/elsif]
> > > [else]
> > >   some other value: [scratch field_contents]
> > > [/else]
> > > [/if]
> > >
> > >
> > > - Ed L.
> >
> >Ed,
> >    Why do you say not to use that in an iterative list?  That
> code doesn't
> >seem too slow to me.  Maybe saving values to scratch variables is slower
> >than I thought.
> >
> >- Grant
>
> I said I would not recommend it. It is ok to do so, but the stand-alone
> [if] is one of the slower ways to make a conditional test in an iterative
> list.

That's good to know.  What would you recommend using instead?

- Grant

> That does not mean that the slowness will be perceptible;
> it depends
> upon conditions and other factors.
>
> - Ed



More information about the interchange-users mailing list