You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Colbert Philippe <co...@rogers.com> on 2006/06/16 15:46:27 UTC

Any way to evaluate an expression without generating empty line on output?

I am writing and using Velocity macros.  Inside the macro, I evaluate certain expressions using $!somexpression.  However, I noticed that Velocity generates an empty line for each of the silent expression line.   That's annoying!   Does anybody have a solution?

CP

Re: Any way to evaluate an expression without generating empty line on output?

Posted by Marc Novakowski <ma...@pandora.com>.
I believe you can use:

$!someexpression ##

and the ## will essentially "comment out" the newline at the end.

I've done this for macros that can't contain extra whitespace (i.e.  
generating URLs).

Marc

On 16-Jun-06, at 6:46 AM, Colbert Philippe wrote:

> I am writing and using Velocity macros.  Inside the macro, I  
> evaluate certain expressions using $!somexpression.  However, I  
> noticed that Velocity generates an empty line for each of the  
> silent expression line.   That's annoying!   Does anybody have a  
> solution?
>
> CP


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


Re: Any way to evaluate an expression without generating empty line on output?

Posted by Barbara Baughman <ba...@utdallas.edu>.
Use !$something.

Barbara Baughman
X2157

On Fri, 16 Jun 2006, Colbert Philippe wrote:

> I am writing and using Velocity macros.  Inside the macro, I evaluate certain expressions using $!somexpression.  However, I noticed that Velocity generates an empty line for each of the silent expression line.   That's annoying!   Does anybody have a solution?
>
> CP

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