velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Serge Emantayev <>
Subject A question about using macros
Date Sun, 17 Jun 2007 19:05:37 GMT

Hi everyone,
I just started to use the Velocity templates. It's an amazing tool. I've a problem using velocity
macros. I have following:

#macro (mymacro $arg $action)
#if (some condition on $arg)

Now, I want to call my macro following way (yes, it's c++ code generation :-) ):

#mymacro ($attribute "\#include \"${}.h\"")

The purpose is to put #include "type.h" whenever the attribute matches a criterion. Unfortunately,
this code does not work, it breaks somewhere near "\#include...". Can you help me to fix it?

Thank you,
Serge Emantayev

Pinpoint customers who are looking for what you sell.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message