filemakerstandards/fmpstandards — pull request #8 by johnchristopherjones (2013-12-13 07:31:08+00:00)
Title: Encode LF in #.fmfn

FileMaker's Value functions treat CR and LF as equivalent, but the Quote function does not. There's no FileMaker escape sequence for LF. For example:

ValueCount ( Quote ( Quote ( List ( "a" ; "b" ; Char ( 10 ) ; "c" ) ) ) ) // Returns 2, expected 1

As a result, # will return invalid Let notation for values containing LF. This problem doesn't appear when using #Get, which doesn't rely on value list processing. However, #Filter fails spectacularly on this invalid result.

The trick is to encode LF. We can do this similarly to how we encode timestmaps. We Substitute LF for a string concatenation with "Char ( 10 )".

https://github.com/filemakerstandards/fmpstandards/issues/7