![]() |
clearbox - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Documentation (https://www.boriel.com/forum/forumdisplay.php?fid=17) +---- Thread: clearbox (/showthread.php?tid=453) |
clearbox - britlion - 04-17-2012 I've added a partial clear screen routine (clearBox.bas) to the library. It does what it says - clears a defined rectangle of the screen. Good for clearing out the bits you don't want, such as the game board, but leave the status bit alone. <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:ClearBox">http://www.boriel.com/wiki/en/index.php ... C:ClearBox</a><!-- m --> Re: clearbox - LCD - 04-17-2012 This comes very handy. Just a little request: If you make comments in Assembly, please do not use the ";" character, but the sequence ";' " because as you can see, the syntax highlighter of the Wiki (and BorIDE) highlighs some comment words as keywords. Using the sequence prevents it from highlighting them. This is just a cosmetic issue. Re: clearbox - britlion - 04-17-2012 Bit ugly, but I see the logic. I still maintain it's a fail on the part of those bits of software, though ![]() Re: clearbox - LCD - 04-17-2012 britlion Wrote:Bit ugly, but I see the logic. I still maintain it's a fail on the part of those bits of software, thoughIn fact the lexer does not know what is Assembler and what is BASIC. Standard lexers can recognise only one syntax, and ZX BASIC has two types of REM characters, which confuse ANY lexer. So the only solution is to use this sequenze in ASM. Talking about it: ASM command SUB opens also a fold point in BorIDE, so I'm not a fan of using same keywords for BASIC as they are used by Assembler. Instead of SUB I would use PROCEDURE or PROC. Re: clearbox - boriel - 04-17-2012 The ZX BASIC lexer uses the Regular Expression: Code: ([']|[Rr][Ee][Mm][ \t]) The ASM / END ASM sequence is a bit special (the lexer enters another state which I guess simple syntax-highlighters doesn't do). Re: clearbox - LCD - 04-18-2012 boriel Wrote:The ZX BASIC lexer uses the Regular Expression:Yes, thats what I mean. It is something special as ";" has a different meaning in BASIC than ASM. Can you add the ability to recognise '-REM char also in Assembly blocks too? I know that it is used in EX AF,AF' too... Now it produces illegal character error. Re: clearbox - BCH - 02-21-2013 I've expanded the routine so it can also save and restore portions of the screen: Code: CLS It adds 2 new parameters: mode (1=clear, 2=save, 3=restore) and address (where the data will be saved to/restore from) Cheers! |