Re: #setprops directive committed
Keats Kirsch <[email protected]> Wed, 19 Oct 2005 19:47:30 -0400
| Newsgroups | gmane.comp.java.webmacro.user |
|---|---|
| Message-ID | <[email protected]> |
Lane Sharman wrote:
> Bummer, keats, about the laptop.
Thanks. :-{
> #setprops $p {
> #include as text "myprops.ini"
> }
>
> so, this will actually work if myprops.ini is a valid property file of
> name=value.
Yep. You can also use the newer colon syntax. Even cooler is that you
can put expression in your prop file -- it's a template. So you can do
stuff like:
#set $resource = "/usr/local/wm/resource"
FontDir: $resource/fonts
TemplateDir: $resource/templates
#set timeoutMins = 5
#set $timeoutMS = $timeoutMins * 60 * 1000
TimeOut: $timeoutMS
etc ...
Of course you need to beware of comments, since they might look like
directives to WM. Just make sure you have a non-alpha char after your #
and it should be fine.
Also, if you want to use the trailing backslash for line continuation,
you'll need to escape it with another backslash. In Java code you
actually need to double-escape, so you need four backslashes! (There's
a unit test for this.)
Keats
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl