velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Reinhardt <mreinha...@hygiene.uni-wuerzburg.de>
Subject Re: How can I define a macro in different file and use it?
Date Sun, 02 Jul 2006 10:48:52 GMT
Velocity Manual:


Colbert Philippe wrote:
> I tried to define a simple macro in one file and using it in another macro file.  I attempted
to do this using #parse.   This is an important functionality for programmers.
>
> Defining a simpel macro in macrolibrary.vm
> ## This macro simply prints its 3 parameters separated by single space
> #macro( myMacro $p1 $p2 $p3 )
> $p1 $p2 $p3 
> #end
>
> Using it in separate file  usingmymacro.vm
>
> #parse( "macrolibrary.vm" )
>
> #myMacro( "alpha" "beta" "gamma" )
>
> Output of running Velocity with my file usingmymacro.vm
>
> #myMacro( "alpha" "beta" "gamma" )
>
> It's as if it does not recognize the difinition of the macro that it parsed.   Has somebody
ran into this problem?
>
>
>
>
>
>
>
>   


---------------------------------------------------------------------
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