# How many characters can a line of source code have?

**URL:** <https://clarionhub.com/t/how-many-characters-can-a-line-of-source-code-have/5210>\
**Category:** questions\
**Tags:** c11, templates\
**Created:** [June 18, 2022, 4:46pm UTC](https://clarionhub.com/t/how-many-characters-can-a-line-of-source-code-have/5210 "2022-06-18T16:46:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon23294430](https://clarionhub.com/user_avatar/clarionhub.com/anon23294430/32/3829_2.png) [@anon23294430](https://clarionhub.com/u/anon23294430)\
**Post date:** [June 18, 2022, 4:46pm UTC](https://clarionhub.com/t/how-many-characters-can-a-line-of-source-code-have/5210/1 "2022-06-18T16:46:16Z")

</div>

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

TIA

---

<div class="post-metadata">

**Author:** ![jslarve](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jslarve](https://clarionhub.com/u/jslarve)\
**Post date:** [June 18, 2022, 9:27pm UTC](https://clarionhub.com/t/how-many-characters-can-a-line-of-source-code-have/5210/2 "2022-06-18T21:27:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vitesse](https://clarionhub.com/user_avatar/clarionhub.com/vitesse/32/837_2.png) [@vitesse](https://clarionhub.com/u/vitesse)\
**Post date:** [June 19, 2022, 2:44am UTC](https://clarionhub.com/t/how-many-characters-can-a-line-of-source-code-have/5210/3 "2022-06-19T02:44:59Z")

</div>

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 🙂

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

---

<div class="post-metadata">

**Author:** ![anon23294430](https://clarionhub.com/user_avatar/clarionhub.com/anon23294430/32/3829_2.png) [@anon23294430](https://clarionhub.com/u/anon23294430)\
**Post date:** [June 19, 2022, 9:52am UTC](https://clarionhub.com/t/how-many-characters-can-a-line-of-source-code-have/5210/4 "2022-06-19T09:52:29Z")

</div>

> [@vitesse](#):
>
> there may also be a compiler limit

Good point

> [@jslarve](#):
>
> maybe it would be better as a resource?

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

> [@vitesse](#):
>
> as I always break lines so that I can see it all on the screen without scrolling right.

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.

---

<div class="post-metadata">

**Author:** ![jslarve](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jslarve](https://clarionhub.com/u/jslarve)\
**Post date:** [June 19, 2022, 1:57pm UTC](https://clarionhub.com/t/how-many-characters-can-a-line-of-source-code-have/5210/5 "2022-06-19T13:57:26Z")

</div>

> [@anon23294430](#):
>
> What do you mean as a resource? Something like the equates.clw or something else?

> [@Retreive data from compiled-in recources](https://clarionhub.com/t/retreive-data-from-compiled-in-recources/3330/4):
>
> You can actually add text files to the ‘Libraries, Objects and Resource Files’ section in the Solution Explorer and those files are then embedded as an IMAGE resource. That makes it easy to use Clarion to retrieve the scripts from either an EXE or a DLL using just the API calls below… MODULE('WINAPI') FindResource(UNSIGNED,LONG,LONG),UNSIGNED,PASCAL,RAW,NAME('FindResourceA') LoadResource(UNSIGNED,UNSIGNED),UNSIGNED,PASCAL, RAW SizeOfResource(UNSIGNED,UNSIGNED),LONG,PASCAL …

---

<div class="post-metadata">

**Author:** ![anon23294430](https://clarionhub.com/user_avatar/clarionhub.com/anon23294430/32/3829_2.png) [@anon23294430](https://clarionhub.com/u/anon23294430)\
**Post date:** [June 19, 2022, 4:05pm UTC](https://clarionhub.com/t/how-many-characters-can-a-line-of-source-code-have/5210/6 "2022-06-19T16:05:56Z")

</div>

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

I dont think that would work.

---

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [June 21, 2022, 4:25pm UTC](https://clarionhub.com/t/how-many-characters-can-a-line-of-source-code-have/5210/7 "2022-06-21T16:25:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon23294430](https://clarionhub.com/user_avatar/clarionhub.com/anon23294430/32/3829_2.png) [@anon23294430](https://clarionhub.com/u/anon23294430)\
**Post date:** [June 21, 2022, 5:04pm UTC](https://clarionhub.com/t/how-many-characters-can-a-line-of-source-code-have/5210/8 "2022-06-21T17:04:05Z")

</div>

Visual Basic line length is 65,535 chars.  
[Limitations - Visual Basic | Microsoft Docs](https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/program-structure/limitations)  
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](https://github.com/editorconfig/editorconfig/wiki/Property-research:-maximum-line-length)  
Nothing in the Supported Properties  
[GitHub - editorconfig/editorconfig-vscode: EditorConfig extension for Visual Studio Code](https://github.com/editorconfig/editorconfig-vscode)  
Nothing here  
[.NET code style rule options - .NET | Microsoft Docs](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options?view=vs-2022)

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](https://stackoverflow.com/questions/59282299/how-to-use-editor-maxtokenizationlinelength-in-a-vs-code-language-extension)

This link [VSCode: Setting line lengths in the Black Python code formatter - DEV Community](https://dev.to/adamlombard/vscode-setting-line-lengths-in-the-black-python-code-formatter-1g62#:~:text=PEP8%20recommends%20a%20line%20length,119%20characters%20(79%20for%20docstrings)) 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.

---

<div class="post-metadata">

**Author:** ![jslarve](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jslarve](https://clarionhub.com/u/jslarve)\
**Post date:** [June 21, 2022, 6:06pm UTC](https://clarionhub.com/t/how-many-characters-can-a-line-of-source-code-have/5210/9 "2022-06-21T18:06:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cwsumner](https://clarionhub.com/letter_avatar_proxy/v4/letter/c/919ad9/32.png) [@cwsumner](https://clarionhub.com/u/cwsumner)\
**Post date:** [June 24, 2022, 5:18pm UTC](https://clarionhub.com/t/how-many-characters-can-a-line-of-source-code-have/5210/10 "2022-06-24T17:18:16Z")

</div>

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. 🕶
