velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colbert Philippe" <>
Subject How can I define a macro in different file and use it?
Date Sun, 02 Jul 2006 04:37:05 GMT
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 

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?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message