473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

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\ArrayAppCoder\Class1.cs(20): Compiler limit exceeded: Line
cannot exceed 2046 characters
Help

Travis
tr********@hotmail.com

Thankyou gurus for your time
Nov 15 '05 #1
6 4381
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********@hotmail.com> wrote in message
news:e$**************@TK2MSFTNGP11.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\ArrayAppCoder\Class1.cs(20): Compiler limit exceeded: Line
cannot exceed 2046 characters
Help

Travis
tr********@hotmail.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********@hotmail.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.com>
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********@hotmail.com> wrote in message
news:e2*************@TK2MSFTNGP11.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.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Travis Kenner <tr********@hotmail.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.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #6
Peter Rilling <pe***@nospam.rilling.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.com>
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
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...
1
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. ...
8
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,...
6
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. ...
7
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 ...
3
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...
9
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...
19
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...
15
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.