Re: [greenstone-devel] {If} in format statements

From Stefan Boddie
DateFri, 9 May 2003 17:51:09 +1200
Subject Re: [greenstone-devel] {If} in format statements
In-Reply-To (3EBB38E8-2070001-cs-waikato-ac-nz)
There's no "eq" operator for the {If} in format statements. Perhaps you're
getting confused with the in macro files which can handle this kind of
thing. Your "{If}{[rights] eq A,..." statement will always evaluate to true
since the "eq A" bit will always be non null, regardless of the value of
[rights].

I've often thought it'd be nice if format statements could do this kind of
thing. Right now it only tests if metadata is null or not though, just like
the manual says.

There are several ugly work arounds you might use. The easiest might be to
set [format] to either 'A' or '', rather than 'A' or 'B'.

regards,
Stefan.

----- Original Message -----
From: "John R. McPherson" <jrm21@cs.waikato.ac.nz>
To: <Stephen.DeGabrielle@ntu.edu.au>
Cc: <greenstone-devel@list.scms.waikato.ac.nz>
Sent: Friday, May 09, 2003 5:13 PM
Subject: Re: [greenstone-devel] {If} in format statements


> Stephen.DeGabrielle@ntu.edu.au wrote:
>
> > format DocumentText "<center><table width=537><tr><td
align=left><br/>{If}
> > {[rights] eq A,IP RIGHTS STATEMENT 'A',IP RIGHTS STATEMENT 'B'}
> > </td></tr></table></center>"
> >
> > I am trying to do a comparison but for some reason cannot get it to
return
> > anything but IP RIGHTS STATEMENT 'A' Is someone able to provide some
advice
> > on using the {If} statement with 'eq', 'ne' and other operators on
metadata
> > fields? (My [rights] metadata for each record is either A or B)
>
> That looks like it should work... perhaps you need quotes around the
> term(s) in the eq test? Otherwise it might be trying to do integer
> comparison rather than string comparison.
>
> > Another situation is to have both A and B in my [rights] metadata
field;
> > Has anyone solved this problem?
>
> Don't know about this situation, sorry. Maybe someone else can
> help with multiple values.
>
> John
>
>
> _______________________________________________
> greenstone-devel mailing list
> greenstone-devel@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel
>