Author |
Topic: LB parses "DATA" word in string (Read 281 times) |
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: LB parses "DATA" word in string
« Reply #4 on: Jul 20th, 2017, 9:50pm » |
|
Quote:| The "Line too long" message is most likely indicating exactly that, i.e. that LBB is unhappy with the length of the line here (once all joined together): |
|
If I change "LOGICDATA" to "LOGICDATAz", making it longer, error didn't show
If I make it shorter just to "DATA" error shows.
Might it be indeed that it is DATA limit, like posted here? 'Line too long' error
EDIT part that works after DATA 150 characters. 158 works, more fails EDIT2 test shows limit for ordinary DATA is 248 Code: NOTICE _
"DATA "+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"
'adding another line produces Line too long
'now I add two lines and change DATA to TADA
'it works no problem
NOTICE _
"TADA "+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"+_
"0123456789"
|
| « Last Edit: Jul 20th, 2017, 9:57pm by tsh73 » |
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: LB parses "DATA" word in string
« Reply #5 on: Jul 20th, 2017, 10:13pm » |
|
on Jul 20th, 2017, 9:50pm, tsh73 wrote:| If I change "LOGICDATA" to "LOGICDATAz", making it longer, error didn't show |
|
Hardly a practical solution for the OP though! My suggestion of splitting the long string into shorter segments is effective, so that's the method I recommend he uses to resolve the problem.
BBC BASIC (into which LBB translates the program) has a maximum line length of about 250 characters so I expect the error arises as a result of that limit. Because of my familiarity with that dialect I prefer not to use very long lines. See also the old thread to which Anatoly links.
I think a similar issue can arise if you load a tokenized (.TKN) program into LBB. When LB generates the TKN file I believe it concatenates any 'continuation' lines (ending in an underscore) so you can end up with a line which is too long for the LBB editor.
Richard.
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: LB parses "DATA" word in string
« Reply #6 on: Jul 20th, 2017, 10:42pm » |
|
Your solution , well, solves problem
But interesting thing is - what's going on?
Obviously it's compile-time error
Print is affected too without concatenation, it takes more characters, (for Notice too) but it breaks if word DATA is present:
Code:print "DATA 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
If I move sequence "DATA " in the middle of a string, it errors too.
If we add a letter after DATA (making string longer) it works Code:print "DATAz 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
And it errors only if word DATA all uppercase.
|
| « Last Edit: Jul 20th, 2017, 10:45pm by tsh73 » |
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: LB parses "DATA" word in string
« Reply #7 on: Jul 20th, 2017, 11:19pm » |
|
on Jul 20th, 2017, 10:42pm, tsh73 wrote:| But interesting thing is - what's going on? |
|
The answer to that can be found in the earlier thread to which you linked. There it says this: "There may be other obscure situations in which it can arise, but again only if the line is very long". This is evidently one of those "obscure situations".
What matters is how best this issue can be resolved to the satisfaction of the OP who encountered it. I have offered an effective solution, which in my opinion improves the readability of the program as well.
I could, in principle, try to trace in the code of LBB exactly what is happening, but what would be the point? The simple fact is that LBB translates the program to BBC BASIC, and BBC BASIC has a maximum line length limit of about 250 characters. In the particular circumstances of the OP's code, this limit is being hit.
Richard.
|
|
Logged
|
|
|
|
RobM
Junior Member
member is offline


Posts: 91
|
 |
Re: LB parses "DATA" word in string
« Reply #8 on: Jul 21st, 2017, 12:13am » |
|
on Jul 20th, 2017, 10:13pm, Richard Russell wrote:| When LB generates the TKN file I believe it concatenates any 'continuation' lines (ending in an underscore) |
|
Yes, I can confirm it does.
|
|
Logged
|
|
|
|
|