I seem to have confused the syntaxes for arguments. See the below example from the documentation:
rating.modify {replace("")|nine|9} replaces the word 'nine' by the number 9, also if the word 'nine' is the whole rating
What is the meaning of the two quotes after replace? It is implied that they are postconditional, as if it is null. Like "when you do the replace, make sure that rating will be left empty".
But if the meaning is this, what is the meaning of:
rating.modify {replace("nine")|nine|9}
Now I assume that it is a preconditional argument, like "check first that rating is nine, then do the replace". In preconditional arguments the manual states clearly that the operation could be omitted, as well as the element to be checked. So, this leaves as with the plain string to check, in this case the string "nine". Am I wrong?
The syntax for both is exactly the same! Could they have different meanings?
means: if rating is equals "" (so empty), do the replace. (so this line will never do anything)
means: if rating is equals "nine", then do the replace (so only when it is "nine", so an extra space in the rating and the replace will also not be done)
Both are preconditional arguments.
The only postconditional arguments are "null" and "notnull" (and "anycase")
OK, that is the way it should be, but the first line I wrote and the mentioned comments ("replaces ... the whole rating") came from the manual!
Page 37, paragraph 4.6.4.9.
Hi ankont,
I just finished the update of the manual, and , indeed that line in it is wrong!! Chapter 4.6.5 is an old one, and I must confess that I didn't check it because I assumed it was still OK. I will review that section next update.
The explanation of Francis is -of course- the correct one.
(In fact the post-conditionals were the first conditionals and are not very much in use, but they are still there because of compatibity reasons.)
Jan