velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Horwitz Steve <>
Subject How can I construct a reference from a value?...
Date Sat, 07 Jun 2003 15:14:07 GMT
Dear Velocity Experts,

  I would like to construct the name of a reference
  from within a template.  Is there a way of doing

  For example, consider the following Velocity
  template code.

               #set( $a = "a" )
               #set( $b = "b" )
               #set( $ab = "3" )
               #set( $p = "$a$b" )
  The value of p will be output as "ab".  What I
  would like is to use the value of p as the *name*
  of the reference.  This would allow me to output
  $ab which has the value "3".

  I've experimented a bit without any luck.  It
  look like the functionality is there.  Can you
  suggest a way of doing this?

  I am using NVelocity, the C# version of Velocity.

                                    Thank you,

                                    Steve Horwitz

Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message