This does not appear to exist. How, then, can I determine the length of EndOfLine? OK - I can set a string to EndOfLine and take the string’s length, but that seems a tad heavy.
NB: I tested and the length is 1 on macOS and 2 on Win7. So, not the same.
EndOfLine is a string, so can just use Len(EndOfLine)
On MacOS, lines always end in a linefeed only (ASCII 10). Windows uses carriage return (ASCII 13) + linefeed (ASCII 10)
However, you can read strings and then parse by EndOfLine.Windows and/or EndOfLine.Macintosh as needed. Ditto for when you’re creating strings.
well, that is a fixed lenght depending on the OS, like John says and all of that is on the documentation
Tim_Hare
(Tim Hare)
November 14, 2021, 2:45am
4
EndOfLine is a method that returns a string. So while Len(EndOfLine) is valid, EndOfLine.Length is not.
1 Like
That it is a method is un-obvious since the doc describes it as a class and one can say such as EndOfline.unix.
Since my app is cross-platform, if I’m calculating a length I want to get the answer in a simple cross-platform way.
len(EndOfLine) does the trick and that’s good enough, so thanks for that.
Of course the IDE says len() is deprecated so go figure.
See blog post: All about EndOfLine
EndOfLine returns an EndOfLine Object, which can convert to string.
For newer version they could add a Length method there.
I would have loved to just see Length being a constant in the EndOfLine class.
For windows with value 2 and 1 for other platforms.
2 Likes