[ic] [if][elsif] question

Kevin Walsh kevin at cursor.biz
Sun Jul 6 22:53:52 EDT 2003

Himem Inc [interchange at himem.net] wrote:
> I have a search page with a drop down that allows users to search 
> different pages (eg search my site, my friends site, or google).  I have 
> this form element named 'site'.  I am trying to do something like this 
> for the results page:
> [if cgi site eq "my friends site"]
>   [then]
>     [bounce href="http://friends-site.com/search/?query=[cgi 
> mv_searchspec]"]
>   [/then]
> [/if]
> [if cgi db eq "google"]
>   [then]
>     [bounce href="http://www.google.com/?query=[cgi mv_searchspec]"]
>   [/then]
> [/if]
> This works fine, however I would rather use an if elsif type form.  But 
> when I change the second if to an elsif, it seems to default to google 
> unless my friends site is specified, such as it is saying else, but not 
> checking the if. Is this correct?  Or am I doing something wrong?
It may be helpful to show an example of the non-working code.  The
following is an example of if/elsif/else code that does work:

    [tmpn foo]bap[/tmpn]

    [if scratch foo eq "bar"]
        Foo is Bar
    [elsif scratch foo eq "baz"]
        Foo is Baz

Perhaps you could compare the above with your non-working code to help
determine what's wrong.  Remember that the [elsif] block MUST be
contained within the associated [if]...[/if], which is probably where
you've gone wrong.  See the numerous if/elsif/else examples in the [if]
section of the Interchange tags documentation.

   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/

More information about the interchange-users mailing list