![]() |
Forum Index : Microcontroller and PC projects : CMM2: Bug with Mm.ErrMsg$
Author | Message | ||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
I've been seeing this one for a while - and it's been p**sing me off in my unit-test framework - but I struggled to reproduce it until I had a poke around the source: 480MHz Colour Maximite 2 G2 MMBasic Version 5.07.01 Copyright 2011-2021 Geoff Graham Copyright 2016-2021 Peter Mather > list "error_test.bas" On Error Skip 1 Error "foo" Print "[ERRORMSG]" Mm.ErrMsg$ "[/ERRORMSG] Print " "; On Error Skip 1 Error "bar" Print "[ERRORMSG]" Mm.ErrMsg$ "[/ERRORMSG] > run "error_test.bas" [ERRORMSG]Error in line 2: foo[/ERRORMSG] [ERRORMSG] Error in line 7: bar[/ERRORMSG] Basically the formatting of the Mm.ErrMsg$ string (whether it starts with a CRLF) depends on the horizontal position of the cursor when the message is generated ![]() I think the offending bytes are probably Src/MMBasic.c#2495: if(CurrentLinePtr < ProgMemory + PROG_FLASH_SIZE) { if(MMCharPos > 1)MMErrorString("\r\n"); // <================= HERE MMErrorString("Error in "); char *ename; This should probably include a check on the value of OptionErrorSkip, or better yet the whole CRLF business should move to where uncaught errors are rendered instead of where there messages are constructed. Also note lines 2468 and 2471 which also seem to be prefixing "\r\n" on error strings (though these do check OptionErrorSkip) ... not sure why has to be done/checked 3 times ![]() Peter I know it's a minor issue, but any chance of fixing it if the other bugs I've reported are going to require a 5.07.02 alpha/beta anyway ? Best wishes, Tom Edited 2021-10-08 19:11 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
I think you are the only person who ever uses mm.errmsg$ but will fix in next beta. |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Probably Peter. Thank you. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
It's nice if it works well though. After all, *I* might need it someday and I'd get all flustered and confused. Even more so than usual, that is. :) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |