[ic] if-loop-param question

Tom Luong tluon002 at lions.odu.edu
Fri Sep 10 11:03:41 EDT 2004


----- Original Message -----
From: Ed LaFrance (New Media E.M.S.) <ic_users at newmediaems.com>


> At 07:47 PM 9/9/2004, you wrote:
>
> > > > > I am trying to get only one <BR> after a series of
[if-loop-param]'s,
> > > if
> > > > > any one of the [if-loop-param] is true then output one <BR> only,
even
> > > if
> > > > > all of these are true.
> > > > >
> > > > > here is the code
> > > > > [if-loop-param city][loop-param city],&nbsp;[/if][if-loop-param
> > > > > state][loop-param state]&nbsp;[/if][if-loop-param zip][loop-param
> > > > > zip][/if]
> > > > >
> > > > > and I want something to do this at the end
> > > > >  [if-loop-param city and/or state and/or zip]<br>[/if]
> > > > >
> > > > Try this sort of thing:
> > > >
> > > >     [tmp tmp][if-loop-param city][loop-param city],
[/if][if-loop-param
> > > state][loop-param state] [/if][if-loop-param zip][loop-param
> > > > zip][/if][/tmp]
> > > >     [if scratch tmp]
> > > >         [scratch tmp]<br>
> > > >     [/if]
> > > >
> > > Thanks Kevin and Ed, the code is great...very clever.  I appreciate
your
> > > help
> > >
> >
> >    Good suggestions for sure. But wouldn't the if structure need to be
like
> >the following ?
> >
> >[if-loop-param city]
> >whatever
> >[/if-loop-param]
> >
> >And assuming so could that have been his original problem ?
> >
> >Jon
>
> You are right about that - Kevin made a typo on the closing [/if]'s. Fixed
> up, his code sample would be:
>
> [tmp tmp][if-loop-param city][loop-param
> city][/if-loop-param][if-loop-param state], [loop-param
> state][/if-loop-param][if-loop-param zip] [loop-param
> zip][/if-loop-param][/tmp]
>
>       [if scratch tmp]
>           [scratch tmp]<br>
>       [/if]
>
> - Ed
>

thats correct, and thanks again, the code works great.
I added another statement so the comma would only show up if both city and
state are present.
heres the snippet...
 [tmp tmp][if-loop-param city][loop-param
city][/if-loop-param][if-loop-param city][if-loop-param
state],&nbsp;[/if-loop-param][/if-loop-param] [if-loop-param
state][loop-param state][/if-loop-param][if-loop-param zip] [loop-param
zip][/if-loop-param][/tmp]

       [if scratch tmp]
          [scratch tmp]<br>
     [/if]

Thanks,
Tom



More information about the interchange-users mailing list