Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ArgumentTypeDescription
listAnyThe list to which value should be added. If this argument is a variable which evaluates to null then a new list will be returned containing only value. If this argument is not a list but a single value then a new list will be returned containing this argument and value.
valueAnyThe item that should be added to list

...

If in.rate is not found then an error message is added to a list of errors found so far. An If() condition is a useful way of building up a list of problems which are found as a Stream is processed.


listToString() can be used to format a list (of errors, say) into a string that can be recorded in a string-valued field on a stream record. Given a list like:

$errors = ["Bad input", "Missing rate value"],

the expression

listToString($errors, "\n") and listToString($errors, ", ") 

will generate output strings like:

"Bad input

Missing rate value"

and

"Bad input, Missing rate value" 

respectively.


See Also