velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <wgl...@forio.com>
Subject Re: Resending email: velocity macro #exit feature
Date Thu, 15 Jul 2004 19:44:31 GMT
Thanks for the note...

As a side point, there is no #exit in the main template, I think you're
referring to #stop.

WILL

----- Original Message ----- 
From: <chenjian@uvic.ca>
To: "Velocity Users List" <velocity-user@jakarta.apache.org>
Sent: Thursday, July 15, 2004 11:47 AM
Subject: Re: Resending email: velocity macro #exit feature


> Hi, Will,
>
> Thanks a lot for your quick response. I will look into modifying the code
> to do it, it should be fun and a good learning experience for me as well.
>
> Yes, you are right, I think #return is a good choice. I was thinking in
> line of the #exit in the main velocity template, thus did not realize this
> one.
>
> By the way, I really enjoyed velocity template engine and the open source
> products in general. It is rocking!
>
> Jian
>
> On Thu, 15 Jul 2004, Will Glass-Husain wrote:
>
> > Hi Jian,
> >
> > There's no "return" or "exit" feature right now for macros.  You might
> > download the source and look into adding it, although it's not the
simplest
> > thing.  You'd have to modify the definition of #macro and add a new
> > directive #exit.  (personally, I like #return as it's a little more
> > subroutine like).
> >
> > WILL
> >
> > ----- Original Message -----
> > From: <chenjian@uvic.ca>
> > To: <velocity-user@jakarta.apache.org>
> > Sent: Thursday, July 15, 2004 11:20 AM
> > Subject: Resending email: velocity macro #exit feature
> >
> >
> > > Hi, All,
> > >
> > > This question is similar to the one for adding a #exit to velocity
> > > template, but, I think maybe more difficult to add this feature.
Anyway,
> > > here is my problem.
> > >
> > > I am writing a macro and I want to do something like:
> > >
> > > ## check for a special case
> > > #if (false)
> > > #exit
> > > #end
> > >
> > > ## general cases, do processing
> > > ...
> > >
> > > Without the #exit feature in the macro, I have to do put all my
general
> > > cases into a #else statement, which is a lot of indenting, since in
the
> > > general cases, there are also lot of if else statements.
> > >
> > > Is it very easy to add the exit feature to velocity macro and could
anyone
> > > let me know how to do it?
> > >
> > > Thanks a lot,
> > >
> > > Jian
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message