[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: Bug report: Problems with variables



On Wed, 7 Jul 1999, Uwe Mindrup wrote:

> Hi,

Hi Uwe,

> I have a problem with variables.
> An example:
> I have a template.wml with this content (very simplified):
> 
> -------------------------------
> <TITLE>foo$(SubTitle:+: )$(SubTitle)</TITLE>
> -------------------------------
> 
> This template.wml is called via
> 
> -------------------------------
> #use <template.wml>
> -------------------------------
> 
> or like this:
> 
> -------------------------------
> #use <template.wml> SubTitle="Homepage"
> -------------------------------
> 
> This second form (with SubTitle set) generates the correct
> form "foo: Homepage".  The first form generates "foo$(SubTitle)",
> but it should generate simply "foo". 

I try with wml-1.7.1 and wml-1.7.2 and can't reproduce your wrong
output.

> When i try this:
> 
> -------------------------------
> <TITLE>foo$(SubTitle:+: $(SubTitle))</TITLE>
> -------------------------------

This one won't work, variables can not be nested like this. If you want
such a feature, write it ;-) Too tricky for me.

> then the first call generates the wrong output "foo)", and the second
> call is still correct.
> It seems, that the first SubTitle greps the wrong closing bracket.

You're right.

> My solution (or bypass) of the problem is very simple. I use:
> 
> -------------------------------
> <TITLE>foo$(SubTitle:+: )\
> $(SubTitle)</TITLE>
> -------------------------------
> 
> and with this slightly changed template.wml both calls are correct.
> Funny, isn't it?

Strange, indeed. Are you sure you try with these examples?

> BTW: I have tried this with wml 1.7.1.

Me too ;-)

--
Denis Barbier
WML Maintainer

______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com