You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Jean Francois Chamard <jf...@interstructure.ca> on 2005/08/12 16:18:27 UTC
velocity user guide - addition
Hi there,
I played with something thismorning and perhaps it would be nice to
have in the "Velocimacro Miscellany" section in the user guide.
I saw somewhere (in the velocity wiki perhaps?) that you could call a
macro and put it in a var
Example: #set($myvar="#mymacro($param)")
Today, I needed to do something like
#set($myvar="#mymacro("String")")
which throw a parsing error.... so you could do
#set($myvar="String")
#set($myvar2="#mymacro($myvar)")
But this is also working, it just looks nicer
#set($myvar="#mymacro('String')")
The next example could not work because the singlequote doesn't parse
(so you would need to use 2 #set ..)
#set($myvar="#mymacro('String$aVarToConcatenate')")
I hope it was useful
Jeff
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org