You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Will Glass-Husain <wg...@forio.com> on 2001/07/31 01:43:07 UTC

using # in strings

Hi,

When I do this in my template, I get a TokenMgr error.

    #set ($Model.NumberFormat = "###0") gives the following exception.

    org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line
1, column 6.  Encountered:  after : ""

I'm pretty sure the Token error will turn into a Velocity Parse error once I
download the nightly build of Velocity.  (Geir fixed this about 2 weeks
ago).

Experimentation reveals that the "###0" is what causes the problem, probably
due to the # signs.  Putting a slash before each # produces the following.

    Exception: org.apache.velocity.runtime.parser.TokenMgrError: Lexical
error at line 29, column 39.
    Encountered: "#" (35), after : "\"\\", message: Lexical error at line
29, column 39. Encountered: "#" (35), after : "\"\\"

Appreciate any help.

WILL


_______________________________________
Forio Business Simulations
Will Glass-Husain
(415) 440-7500 phone
(415) 235-4293 mobile

wglass@forio.com
www.forio.com