Homec4science

Fixed a bug concerning empty fields. Functions attached to fields are no longer…

Authored by Nicholas Robinson <nicholas.robinson@cern.ch> on Jan 15 2007, 19:02.

Description

Fixed a bug concerning empty fields. Functions attached to fields are no longer ignored when the field has no value.

E.g. Consider the following line:

300---<datafield tag="300" ind1=" " ind2=" "><subfield code="a"><:Num::Num:><:Num::Num::IF(,mult. p, p):></subfield></datafield>

If there is no value for the field "Num", the desirable output is:

<datafield tag="300" ind1=" " ind2=" "><subfield code="a">mult. p</subfield></datafield>

However, this did not work - when Num had no value, the function (IF in this case) was ignored and the line was not printed.
This has been fixed. Also now, given the following template line:

300---<datafield tag="300" ind1=" " ind2=" "><subfield code="a"><:Num::Num:><:Num::Num::IF(,, p):></subfield></datafield>

If the value of Num is "33", the following will be printed:

<datafield tag="300" ind1=" " ind2=" "><subfield code="a">33 p</subfield></datafield>

If however Num has no value, the line will not be printed. This is because the "IF" function will return nothing, and it is considered
undesirable to print the line.

Event Timeline

Nicholas Robinson <nicholas.robinson@cern.ch> committed R3600:e36e5294ad2d: Fixed a bug concerning empty fields. Functions attached to fields are no longer… (authored by Nicholas Robinson <nicholas.robinson@cern.ch>).Jan 15 2007, 19:02