How many characters can a line of source code have?

Does anyone know how many characters the C11 IDE text editor can handle, ie how wide can it go?

TIA

Just 1 character below where it blows up.

If you are trying to link in a bunch of data, maybe it would be better as a resource?
If you’re trying to cram a lot of code, don’t do that.

also if you are talking about how wide a line of code can be, there may also be a compiler limit. I’ve never pushed it though as I always break lines so that I can see it all on the screen without scrolling right.

If you want to see how wide the editor in the ide goes maybe just hold down a key on the keyboard :slightly_smiling_face:

maybe there is a 64k limit or maybe not - either way as Jeff says “don’t do that”.

Good point

What do you mean as a resource? Something like the equates.clw or something else?

I can put the 3 monitors here which are 1920x1080 into one big pseudo ultrawide monitor with a resolution of 5760x1080 but the app I’m working on which reads and writes code has to have an upper limit of the number of lines it can work with this is why I ask if anyone knows.

Ok, so a resource in the context of an image or icon resource included in the project system.

I dont think that would work.

You have the IDE test it yourself. Create some long lines of Var=‘Text 1234567890 … END’. See what saves and reopens, what compiles, what displays at runtime.

I would not go over 1024 bytes. That’s the limit of a TEXT control, … that {PROP:Line,#} will return. That’s the limit of an INI file. Various code utilities will likely have limits. I would keep it to 256.

The Editor was written by Sharp Develop to match Visual Studio so that VS editor limit would be worth looking up.

Visual Basic line length is 65,535 chars.
Limitations - Visual Basic | Microsoft Docs
I dont know if Visual Basic uses Visual Studio, as I dont really use Visual Studio.

Found this but nothing to suggest a max line length
Property research: maximum line length · editorconfig/editorconfig Wiki · GitHub
Nothing in the Supported Properties
GitHub - editorconfig/editorconfig-vscode: EditorConfig extension for Visual Studio Code
Nothing here
.NET code style rule options - .NET | Microsoft Docs

I dont know what tokenisation is, but there is a suggestion it might be found in VS by going to File --> Preferences --> Settings and search for Max to find Max Tokenisation Length.
How to use editor.maxTokenizationLineLength in a VS Code language extension? - Stack Overflow

This link VSCode: Setting line lengths in the Black Python code formatter - DEV Community suggest it might be user configerable in VScode and I dont know how much that is the same as the VS editor.

I’ll work on the basis its 65,535 chars long.

If we ever get unicode support, I wonder if that would impact it.
You can save unicode in the text editor, and that will cause the document to be saved with unicode BOM. But it won’t compile.

Editors used by programmers are usually “character-stream buffers” and not line oriented except in the display.

A big reason we (GE) got away from DEC editors back in 1980 was because they were line-oriented. I do not recommend you go back to 1980!

Compilers also use character-streams for input (except for emergency checks). Text files, even Basic format, are character-streams.

It’s not that hard to format the stream for display in lines. There are instructions about it… from 1980. :sunglasses: