![]() |
Forum Index : Microcontroller and PC projects : CMM2: Bug reports
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4301 |
BUG: Unexpected ON ERROR SKIP behaviour: Try this one for size: Option Explicit On Dim a Cls foo() Sub foo() Print "foo" a = 1 bar() ' Should print "1", but instead "Error: A is not declared" Print a End Sub Sub bar() Print "bar" On Error Skip 1 b = 5 If MM.ERRNO <> 0 Then Print "Error; "; MM.ERRMSG$ On Error Clear If MM.ERRNO = 0 Then Print "Error cleared" End Sub Yes, it looks contrived, but it is simplified from a real world case. Regards, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3282 |
Hmm, this is one for me. When I run your code I get: foo bar Error; Function or array $ not declared Error cleared 1 This output is correct except that the message is misleading. It should say: "Function, variable or array not declared" This is an easy fix and will be in the next MMBasic release. Thanks for finding it. Geoff Edited 2020-06-15 23:35 by Geoffg Geoff Graham - http://geoffg.net |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10189 |
Geoff: What did you just test on? On the latest CMM2 code there is an additional bad issue. UPDATE: found the issue, bloody caching again. Caching and longjmp do not like each other. Edited 2020-06-16 00:10 by matherp |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10189 |
V5.05.03b1m Fixes bugs in ON ERROR SKIP Improved MM.ERRMSG$ to give the full text of the error with substitutions of data made and file name (if an include file) and linenumber http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4301 |
Thank you, that seems to have fixed the real problem too. I thought longjmp was goto's evil twin? or is it a necessary evil of programming close to the metal? Thanks, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3282 |
Tested on CMM2 V5.05.02 (final) It is dangerous and in C it is rarely needed. In MMBasic it is used when the interpreter is many functions deep trying to interpret the BASIC program and discovers an error (ie, syntax). It is not practical to back out of all these functions so a longjump is used to jump to the command prompt and cleanup the C stack at the same time. Geoff Graham - http://geoffg.net |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3282 |
Geoff Graham - http://geoffg.net |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3282 |
Something strange happened with the last post. I was trying to say that the bug is also in the Micromite code and I will fix it there. Geoff Graham - http://geoffg.net |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10189 |
That's why some bugs are so difficult to find. There has been absolutely no change in the relevant code since 5.05.02 and yet it behaved exactly like the MM2. A different compilation and some slight change in the combination of caching and longjmp b..g..rs things up |
||||
MauroXavier Guru ![]() Joined: 06/03/2016 Location: BrazilPosts: 303 |
Peter, in the V5.05.03b1m firmware an old bug has returned... Now when I make some little changes in my code and when running it, it stills the same as before, like the previous source had cached and the new code is ignored. Only more significant changes in the source code make the execution right. |
||||
KeepIS![]() Guru ![]() Joined: 13/10/2014 Location: AustraliaPosts: 1865 |
Small minor note about autosave launched from the command line. As you type some of the chars are underscored on the VGA display. Not a big deal as it's mostly used for quick file transfers. I occasionally use it from the command line to quickly create a new bas file. I was wondering how that might look to new users coming across from the Silicon Chip release. Mike. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 1094 |
Type in OPTION SD TIMING CONSERVATIVE OPTION LIST says OPTION SD SPEED CONSERVATIVE. ChopperP |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10189 |
This is the cursor and shouldn't be showing for autosave - will fix OPTION LIST says OPTION SD SPEED CONSERVATIVE. Will fix I need an example file and an example edit to diagnose. You have my email address, please send something. This is almost certainly another caching issue as the code can't do what you describe |
||||
MauroXavier Guru ![]() Joined: 06/03/2016 Location: BrazilPosts: 303 |
Ok, I will send directly to you soon as possible. I found a bug in the TEXT command. When I put a transparent setting -1 to the font, the bottom of background was corrupted. Try to load a image and use the TEXT command like this: TEXT 40,40,"THIS IS A TEST",LT,4,4,RGB(255,255,255),-1 The corruption always occurs from the middle of font to bottom, and if you use the scale, the corruption follows the size too. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10189 |
TEXT 40,40,"THIS IS A TEST",LT,4,4,RGB(255,255,255),-1 I don't see any corruption but you remind me there is a trivial optimisation for outputting transparent test that I've been meaning to make for ages that might solve your issue I look forward to getting your test files |
||||
MauroXavier Guru ![]() Joined: 06/03/2016 Location: BrazilPosts: 303 |
When I come back from the job I will send the files. About the text corruption, for me it occurs exactly this way: MODE 2,16 PAGE WRITE 2 CLS LOAD PNG "ANYIMAGE.PNG" PAGE WRITE 1 CLS DO WHILE 1=1 PAGE COPY 2 TO 1,I TEXT 40,40,"THIS IS A TEST",LT,4,4,RGB(255,255,255),-1 PAGE COPY 1 TO 0,I LOOP In any case, in the same files that I will send to you I will enable text in a way that will show the bug. Edited 2020-06-17 00:34 by MauroXavier |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10189 |
MODE 2,16 PAGE WRITE 2 CLS LOAD PNG "ANYIMAGE.PNG" PAGE WRITE 1 CLS DO WHILE 1=1 PAGE COPY 2 TO 1,I TEXT 40,40,"THIS IS A TEST",LT,4,4,RGB(255,255,255),-1 PAGE COPY 1 TO 0,I LOOP Now you give me the full information (writing to page 1) I know what the issue is and have fixed it. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10189 |
V5.05.03b1n Fixed a bug in transparent text when writing to a page other than page 0 Improved performance of transparent text output Added various functions to the list for colour coding in the editor Corrected the OPTION list text for OPTION SD TIMING CONSERVATIVE Fixed bug in cursor when typing manually into AUTOSAVE Flushed caches before doing compare of existing program with edited version Close all open files after an error http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip Edited 2020-06-17 00:58 by matherp |
||||
MauroXavier Guru ![]() Joined: 06/03/2016 Location: BrazilPosts: 303 |
Humm... I will test this version before send the files to you, as this maybe fix my previous issue. Anxious to back to my home and test it. Thanks for your so fast update! |
||||
CircuitGizmos![]() Guru ![]() Joined: 08/09/2011 Location: United StatesPosts: 1427 |
V5.05.03b1n Option for US keyboard reverts to UK both from the selection of the initial power-on message and also if OPTION USBKEYBOARD US is used. Micromites and Maximites! - Beginning Maximite |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |