LB Booster
Programming >> Compatibility with LB4 >> "Line too long" error
http://lbb.conforums.com/index.cgi?board=compatibility&action=display&num=1379020489

"Line too long" error
Post by Phineas Freak on Sep 12th, 2013, 9:14pm

I tried to compile a program that contains the following DATA structure:

Code:
  data "1",        "2",        "4",        "8",
       "10",       "20",       "40",       "80",
       "100",      "200",      "400",      "800",
       "1000",     "2000",     "4000",     "8000",
       "10000",    "20000",    "40000",    "80000",
       "100000",   "200000",   "400000",   "800000",
       "1000000",  "2000000",  "4000000",  "8000000",
       "10000000", "20000000", "40000000", "80000000",
       "0" 


And when compiler reached that line, it stopped with a "Line too long" error.
Re: "Line too long" error
Post by Richard Russell on Sep 12th, 2013, 10:36pm

on Sep 12th, 2013, 9:14pm, PreciseTiming wrote:
And when compiler reached that line, it stopped with a "Line too long" error.

Not at all surprising - the message means exactly what it says! There is no benefit in trying to put a large number of items into a single DATA statement; change it to use multiple DATA statements as follows:

Code:
data  "1",        "2",        "4",        "8"
data  "10",       "20",       "40",       "80"
data  "100",      "200",      "400",      "800"
data  "1000",     "2000",     "4000",     "8000"
data  "10000",    "20000",    "40000",    "80000"
data  "100000",   "200000",   "400000",   "800000"
data  "1000000",  "2000000",  "4000000",  "8000000"
data  "10000000", "20000000", "40000000", "80000000"
data  "0" 

Both LB and LBB will be happy with that.

Richard.
Re: "Line too long" error
Post by Phineas Freak on Sep 13th, 2013, 11:55am

Well, should i dare to say that i didn't think about breaking it in multiple lines...? tongue

Liberty BASIC didn't complain about it so i though it might be a general incompatibility about long lines, not only for this particular case. Although that there are always workarounds...
Re: "Line too long" error
Post by Richard Russell on Sep 13th, 2013, 1:31pm

on Sep 13th, 2013, 11:55am, PreciseTiming wrote:
i though it might be a general incompatibility about long lines

It's not a general incompatibility; LBB should very rarely complain about over-long lines.

The underscore line-continuation character is valuable when declaring a menu or a structure, when it's handy to be able to put each item on a separate line. It can also be useful when assigning a long string constant, such as help text. But I'm not a great believer in using long lines when it doesn't benefit program clarity.

Richard.
Re: "Line too long" error
Post by Phineas Freak on Sep 14th, 2013, 07:36am

I should be more careful next time that i will use the line continuation...