I know I’m doing this wrong. I defined CR as a Method with this code
return chr(13)
But then when I use it, I must reference it as “app.CR” That’s awkward.
I thought it would be best to define CR and Tab as properties but the Default parameter interpreted chr(13) or chr(10) as a literals and not the ascii value. I also tried using the code box of the Property to assign chr(13) to the CR property.
return chr(13)
cr=chr(13)
But that did work either.
you realize (or perhaps not). that those are PRE-DEFINED for you?
EndOfLine.Macintosh = Chr(13)
EndOfLine.Unix = Chr(10) // this is the default for macOS and Linux
EndOfLine.Windows = Chr(13)+ Chr(10) // this is the default for Windows
but to answer you question… create a MODULE and place them there… that will make them global and not restricted to a namespce (app)
I’ve defined them as constants in the past. Only used them when communicating with MCUs projects where ei have to contorl the exact characters. For anything else I use EndOfLine as Dave suggested.