473,788 Members | 2,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exceeding line length

I am new to C# but cannot find how to avoid exceeding
thje line length for coding when using a really really long
array. I get this error message and dont know how to break up long lines of
code.
D:\C#Programs\A rrayAppCoder\Cl ass1.cs(20): Compiler limit exceeded: Line
cannot exceed 2046 characters
Help

Travis
tr********@hotm ail.com

Thankyou gurus for your time
Nov 15 '05 #1
6 4407
May I ask why you have lines that long? What makes your lines so long?
What does an array have to do with the size of a source code line?

"Travis" <tr********@hot mail.com> wrote in message
news:e$******** ******@TK2MSFTN GP11.phx.gbl...
I am new to C# but cannot find how to avoid exceeding
thje line length for coding when using a really really long
array. I get this error message and dont know how to break up long lines of code.
D:\C#Programs\A rrayAppCoder\Cl ass1.cs(20): Compiler limit exceeded: Line
cannot exceed 2046 characters
Help

Travis
tr********@hotm ail.com

Thankyou gurus for your time

Nov 15 '05 #2


The reason it is so long is that I am simply trying to parse a very very
very long line of text so I just put it in an array and then I am trying
to process every 5th character in it and copy it to another array.
Help

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #3
Travis Kenner <tr********@hot mail.com> wrote:
The reason it is so long is that I am simply trying to parse a very very
very long line of text so I just put it in an array and then I am trying
to process every 5th character in it and copy it to another array.


But the array itself can have line breaks in, and a line of text can be
split as:

string x = "this is quite a long line which will wrap in a moment "+
"ah yes it's wrapped now";

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #4
Are you hardcoding the string in your program? One alternative might be to
load the string from some external source such as a resource or a text file.

"Travis Kenner" <tr********@hot mail.com> wrote in message
news:e2******** *****@TK2MSFTNG P11.phx.gbl...


The reason it is so long is that I am simply trying to parse a very very
very long line of text so I just put it in an array and then I am trying
to process every 5th character in it and copy it to another array.
Help

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #5
This would probably depend on what the compiler defines a "line". It could
refer to a "statement" rather then a "line", in which case this would still
be a single statement.

"Jon Skeet [C# MVP]" <sk***@pobox.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
Travis Kenner <tr********@hot mail.com> wrote:
The reason it is so long is that I am simply trying to parse a very very
very long line of text so I just put it in an array and then I am trying
to process every 5th character in it and copy it to another array.


But the array itself can have line breaks in, and a line of text can be
split as:

string x = "this is quite a long line which will wrap in a moment "+
"ah yes it's wrapped now";

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #6
Peter Rilling <pe***@nospam.r illing.net> wrote:
This would probably depend on what the compiler defines a "line". It could
refer to a "statement" rather then a "line", in which case this would still
be a single statement.


Fortunately, the compiler is telling the truth, according to a quick
test.

Very large statements are reasonably common if you've got a large array
with lots of members to initialise, spread over lots of lines.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
14158
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of uninitialized value in concatenation (.) at register.pl line 38, <STDIN> line 10." The PERL code is as follows:
1
5475
by: T.S.Negi | last post by:
Hi, A query is exceeding the length of varchar and nvarchar variable. Because I'm picking the data from each record from table and giving it to the query. suggest me some way to do it. sample query:
8
4730
by: Hal Vaughan | last post by:
Is there a maximum length for Javascript program lines? What about strings? Is there a limit on string length? I found some references that said the maximum string length was 256 characters, but I have a program that created a string of over 25,000 characters (the browser was Konqueror). Are there limits on these lengths? If I require a newer browser for the program I'm writing, would that change the situation?
6
8174
by: DLP22192 | last post by:
I have the following single-line if statement that is evaluating true even though it shouldn't. I have never seen this before and I am concerned that this can happen in other areas of my code. If String1.Length > 0 Then String2 = String1 where String1 = "" This statement also evaluates as true when String1 = "":
7
2814
by: jamait | last post by:
Hi all, I m trying to read in a text file into a datatable... Not sure on how to split up the information though, regex or substrings...? sample: Col1 Col2 Col3 Col4 A0012430 REKAL TVÄTTMEDEL EKOMAX 0,5L ST 75.9000
3
3058
by: Axel Siebenwirth | last post by:
hi! there is something I dont quite understand. I have a paragraph within a layer. It looks like this: <div id="ueber_uns"> <p> Einige Leute sind der Ansicht unersetzbar zu sein und alles alleine in die Hand nehmen zu müssen... Wir teilen diese Ansicht.Von der Planung und Vorbereitung bis hin zur Umsetzung und Koordination sportlicher
9
5212
by: Adi | last post by:
Hello eveyone, I wanna ask a very simple question here (as it was quite disturbing me for a long time.) My problem is to read a file line by line. I've tried following implementations but still facing problems: Assume that FILE* filePointer; unsigned char lineBuffer;
19
2458
by: =?Utf-8?B?QnJpYW4gQ29vaw==?= | last post by:
This is an example of the data; 2007/07/27 11:00:03 ARES_INDICATION 010.050.016.002 404.2.01 (6511) RX 74 bytes 2007/07/27 11:00:03 65 11 26 02 BC 6C AA 20 76 93 51 53 50 76 13 48 2007/07/27 11:00:03 52 00 52 02 02 C7 83 D7 07 07 1B 0B 00 00 00 00 2007/07/27 11:00:03 28 0A 06 06 06 06 06 06 06 06 06 06 06 0A 06 06
15
2830
by: Spiros Bousbouras | last post by:
I'm thinking of adding a command to vim for removing white space from the end of each line of a C source file. Can anyone think of a situation where such white space might be useful ?
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.