Max source code line length

Hello everyone,

What is the max length of a line of source code? The compiler seems to break long lines into smaller sections as separated lines that result in compiler errors. Sometimes, it even insert random new lines in code below the original long line.

Thanks!

I don’t know the answer, but you know you can break up long lines?

var a as integer = _
    b + _
    c + _
    d

var s as string = _
    "this represents " + _
    "some long string, " + _
    "and the compiler " + _
    "will recognize that " + _
    "it's just really one " + _
    "string"

Better, the IDE will help you with things like option-return at the end of a line or the middle of a string.

1 Like

Thank you, Kem!

1 Like

Also, if you didn’t know, the shortcut for this is CTRL+Enter on Windows/Linux or Option+Return on Mac.

https://documentation.xojo.com/api/language/line_continuation.html

2 Likes

Thank you. I was looking in the Documentation for “source code line” and “code line length.” :slight_smile: