It would seem then, that we should do our best to take cr( out of our vocabulary.
If you’re asking my opinion, then no, I don’t think this is a good strategy. In fact, I think you’ll actually make life more difficult for yourself with this strategy.
When displaying and editing text, Apple’s code treats carriage returns and line feeds the same. Either one of these characters starts a new line. In fact, the only difference between classic Mac OS and OS X/macOS is what character gets inserted when you press the return key. In classic Mac OS (and when using a Carbon app like Panorama 6) pressing the return key inserts a return character. In OS X/macOS, pressing the return key inserts a line feed.
The bottom line is that you have to assume that any text that is edited by Apple’s code could have carriage returns, line feeds, or a mix of both. In fact, this is not just true for Apple’s code, but also external editors like BBEdit, or text retrieved from the web. In fact, you might also find text that uses CR-LF for line breaks.
So bottom line, you can’t just assume that line breaks are represented by line feeds. Maybe yes, maybe even most of the time, but not 100%. This is not under Panorama’s control.
However, it really doesn’t matter what the line break character is - UNLESS you are planning to use the text as a text array. Then you need to know exactly what the separator is, and my strategy is to use either lftocr( or crtolf( right before I start using text as an array. For example, text from a file:
lines = lftocr(binarytotext(fileload("some path")))
looparray lines,cr(),line
... do something with line
endloop
Or text from a database field:
lines = lftocr(SomeField)
looparray lines,cr(),line
... do something with line
endloop
Or text from the clipboard:
lines = lftocr(clipboard())
let modifiedLines = arrayfilter(lines,cr(),{... some formula}
In my experience you have to use either lftocr( or crtolf( in these situations, because you just don’t know for sure what separator (or separators) is being used in these external data sources. I usually use lftocr(, because as you say, Panorama has a lot of statements and functions that explicitly work with CR delimited text. For example:
let clipFirstLine = firstline(lftocr(clipboard()))
gets you the first line of the clipboard. Now you could also do it this way:
let clipFirstLine = array(lftocr(clipboard()),1,lf())
but I think the first is easier and clearer. What I would not recommend is this:
let clipFirstLine = array(clipboard(),1,lf())
This last bit of code is assuming there are line feeds being used as line breaks, but I don’t think that is a safe assumption. Best bet is to use lftocr( every time when you transition from an “external” source of text (which includes database fields because they are edited by Apple’s code) to using the text as a text array.
I use cr( as a separator constantly.
So to summarize, I would stick with using cr( as a separator for the most part, and just make sure to use lftocr( before using a text value from an external source as a text array. In fact, not only would I recommend that, that’s exactly what I have done in my coding. Panorama’s own libraries and wizards have several dozen lftocr( functions strategically placed as needed, and also a couple dozen crtolf( functions (I think mostly when I wanted to export a text array back out to something external, like a text file).