![]() |
Forum Index : Microcontroller and PC projects : PicoMite continuation lines - experimental version for comment
Author | Message | ||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Attached is a PICO and VGA RP2040 version for test/comment. PicoMiteRP2040V6.00.02RC20e.zip PicoMiteRP2040VGAV6.00.02RC20e.zip Changes New command OPTION CONTINUATION LINES ON/OFF/ENABLE/DISABLE This is a permanent option but doesn't cause a reboot When enabled it changes behaviour as follows: The back single quote character chr$(96) is used as a line continuation when it appears as the last character on a line. The LIST command and EDIT commands will automatically insert line continuation characters when used. This will be inserted at a space or comma character if possible or at the last displayable character as defined by OPTION DISPLAY. All text in a program will therefore be viewable in the editor When in the editor you can use the line continuation character to split lines. However, on saving these effectively disappear but are recreated when the program is listed or edited. NB: They may not therefore be in the same place. When you use EDIT fname$ continuation characters are created as the file loads and then removed again when the file is saved. The way that this works is that the tokeniser effectively strips the continuation characters out of the program and joins the lines. The normal maximum line length applies. When editing/listing the saved file, the new functionality inserts the line continuation characters as described above. Example Original file CLS Restore lalinea n=1 Read x1,y1 Do Read x2,y2:Inc n:If x2=0 Then Exit If y2=255 Then Read x1,y1,x2,y2:Inc n,2 Line x1,y1,x2,y2:Line x1+1,y1,x2+1,y2:Line x1,y1+1,x2,y2+1 x1=x2:y1=y2 Loop 'Print n LaLinea: Data 1,149,46,149,1,255,90,149,112,149,112,136,111,119,110,105,106,89 Data 73,104,72,113,70,119,68,125,67,126,65,123,63,122,64,119,61,118 Data 62,113,65,106,60,106,58,102,65,102,104,78,100,73,99,70,99,65,101,61 Data 104,55,113,48,119,44,125,41,130,40,131,43,131,47,129,50,124,54,118,57 Data 125,57,122,63,121,67,121,76,124,80,127,79,130,74,131,71,132,71,134,76 Data 139,77,149,82,151,84,151,88,147,100,144,104,146,107,148,104,150,108 Data 149,110,150,108,153,109,152,112,149,115,153,121,152,124,150,123,144,117 Data 143,135,142,144,140,149,223,149 Data 0,0 As it appears in the editor with a line width of 40 characters ![]() Edited 2025-05-05 00:47 by matherp |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Clever Peter, but now can you be persuaded to go the extra mile and use '_' instead of '`' as the line-continuation character so as to match the "prior art" of VisualBasic and FreeBASIC ? I believe VB requires the underscore to be preceded by a space, but FreeBASIC does not unless it immediately follows an identifier or keyword. It would be nice if it was clever enough to work within string literals too, though there are some more edge cases there especially when automatically breaking up the strings. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
The problem is that underscore is a valid character in variable names and I also use it to code some commands that appear to start with a period. As a proof of concept I wanted to avoid anything that possibly has unexpected side effects. The back quote is so rarely used and has no use in MMBasic except in a string so it makes an ideal character. The current mechanism will split inside a string without issue Edited 2025-05-05 01:21 by matherp |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
I understand, but I also stand by my "prior art" argument if this goes beyond proof of concept, it just makes the trickery a little trickier; the underscore is also a valid identifier character in VB and FreeBASIC I believe. Nice. Not that it changes the argument but the back-tick is rendered as the degree symbol in most (all ?) PicoMite fonts, this confused some PicoCalc folks who thought they had a keyboard problem. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Tom Do you want to do some testing? I've set it to use underscore. What version do you want? |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
LOL, you've called my bluff ;-). Let's try using it on the Game*Mite (since that is the most constrained environment), so a standard PicoMite RP2040 build. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Here you go PicoMiteRP2040V6.00.02RC20e.zip In this version if you use OPTION CONTINUATION LINES ON it defaults to underscore. However, you can also use OPTION CONTINUATION LINES n where n is the ascii code for the character you want to use. I've tried stupid things like s$="____________________ " and it seems to work - the string just ends up 1 underscore shorter as expected Edited 2025-05-05 02:14 by matherp |
||||
twofingers Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1527 |
I don't like Chr$(96) either. I would also prefer the underscore, but it often doesn't display correctly in the editor. How about ~ (Chr$(126) )? Regards Michael to slow! ![]() Edited 2025-05-05 02:18 by twofingers causality ≠ correlation ≠ coincidence |
||||
cosmic frog Senior Member ![]() Joined: 09/02/2012 Location: United KingdomPosts: 300 |
Or what about just - OPTION CONTINUATION LINES ON [,n] Thanks. Dave. |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4854 |
Peter, I will try to duplicate on a genuine vga design 2, then diagnose further. Tonight. I have visitors now... Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Harm Don't spend any more time until I have worked through all possible logic looking for holes - I have seen a couple of potential issues |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |