CPCWiki forum

General Category => Programming => Topic started by: mr_lou on 12:05, 21 June 18

Title: BASIC: Line too long
Post by: mr_lou on 12:05, 21 June 18
So I'm playing around with PRINT, just printing a bunch of control codes for various stuff, like control codes instead of SYMBOL commands.

There's room for a certain amount of characters on a line, but I'm experiencing a "Line too long" error sometimes despite of this. Can anyone explain what a plain PRINT line can give a "Line too long" error?
Title: Re: BASIC: Line too long
Post by: Bryce on 12:49, 21 June 18
Are you possibly using ? as a shortcut instead of typing the whole word PRINT?

Bryce.
Title: Re: BASIC: Line too long
Post by: freemac on 13:05, 21 June 18
A missing special char "end of file of BASIC script" can give this error. Or else a basic line... too long (line of basic code, not line in screen :p)

I got this problem last week with a PRINT that contains a lot of ";chr$(224);" inside, so I solved that using c/c (in ASCII with notepad++) :

https://github.com/renaudhelias/RubikCubePaletteCPC/blob/master/JDVPA%235_test/COMBAT2.BAS (https://github.com/renaudhelias/RubikCubePaletteCPC/blob/master/JDVPA%235_test/COMBAT2.BAS)
load "combat2.bas
goto 821

notepad++ has a hex to binary converter, and Excel has a dec to hex converter funtion : DECHEX()
Perhaps I missed something, chr$(n) seems not using same value as binary char in ASCII...
Title: Re: BASIC: Line too long
Post by: Sykobee (Briggsy) on 13:51, 21 June 18
IIRC I used to print chr$(whatever) and then in the basic editor use the copy functionality to inline it into the program line.


Of course these days that doesn't get your code easily onto github :p
Powered by SMFPacks Menu Editor Mod