velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <d...@solaraccess.com>
Subject Re: Character precision...
Date Wed, 13 Aug 2003 16:52:56 GMT
On Wed, 2003-08-13 at 12:15, Rodrigo Reyes wrote:
> Mmmm... Interesting... Please, give me an example...
> > Liberal sprinklings of the ## (double comment character) really spruce
> > things up a bit. I generate text emails with velocity all the time; as
> > long as I ## lots of places I'm ok.

Here's an example of the top of one of my really old template files. The
interesting bit for you may be the trailing ## so that the output of the
macro doesn't get a newline.

Hope this helps!

Dave

##--------------------------------------------------------------------
## Macros and misc
##--------------------------------------------------------------------
#macro(cdval $cd)
#if (${cd.quote})
#if(${cd.sqlified})
"'" + StringUtils.sqlify(${cd.name.lower()}) + "'"##
#else
"'" + ${cd.name.lower()} + "'"##
#end
#else
${cd.name.lower()}##
#end
#end
##
##
#macro(tscast $col)
#if (${col.isdate})
(FigTimestamp) ##
#end
#end
##
##--------------------------------------------------------------------
## Header stuff
##--------------------------------------------------------------------
##
package ${beaninfo.packagename};

import java.sql.*;

import com.solaraccess.util.StringUtils;
import com.solaraccess.util.SolarException;
#if (${beaninfo.havetimestamp})
import com.solaraccess.util.FigTimestamp;
#end

/**
 * ${beaninfo.tablename} row bean
 */

public class ${classname} extends DBRow {

[... snip ...]



Mime
View raw message