velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uday Kumar" <>
Subject Can a variable have local scope?
Date Thu, 12 Jul 2001 23:43:37 GMT

Can I have a variable with local scope in velocity? I wrote a macro that
calls itself again and again and I have defined a variable in that macro and
set it to 1. Each time the macro calls itself, the variable is incremented
by 1. but, when the control comes back to the calling macro, the old value
is not retained and instead the new value is being used. (The application
that I am using here is like printing a binary tree)

Please help me in this regard


----- Original Message -----
From: "Tim Colson" <>
To: <>
Sent: Thursday, July 12, 2001 10:14 AM
Subject: RE: calling setProperty(float) not possible ?

> > Velocity will recognize as arguments to directives, velocimacros and the
> > RHS of #set() :
> > snip
> Say - is this good stuff in the docs? If not, please consider adding it as
> an additional section "Geeky Details". Seriously, it's good to know.
> > With strings, '$foo' is handled literally, "$foo" is actually
> > 'rendered'.  So you can get away with all sorts of wacky things
> Cool - you can do interpolation on strings and even use directives!
> Diabolically yours,
> Tim

View raw message