![]() |
Forum Index : Microcontroller and PC projects : CMM2: Bug in ERROR command ?
Author | Message | ||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Hey CMM2 gurus, Run the attached file on CMM and CMM2. error_.bas.zip On CMM output is: Hello, World Error: WTF! On CMM2 output is: Hello World, Error: error_.bas I believe the CMM is correct and the CMM2 is wrong. I also believe there is some memory corruption problem with Error such that after an Error has been thrown the next invokation of the Editor hangs the system (which requires a reset of the Waveshare) when it tries to Run or Save. This is a heisenbug, it happens consistently when I'm not trying to reproduce it, and not at all when I am !!! Hope this helps, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
I didn't even know there was a command ERROR. It certainly hasn't been converted to match the changes in the way MMBasic works on the CMM2 so it is not surprising it doesn't work! Why does it even exist? Clearly none of the development team ever tested it. I'll see what I can do. |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3292 |
You use it when your program needs to fail gracefully. For example: IF MM.I2C = 2 THEN ERROR "Cannot find device" Geoff Geoff Graham - http://geoffg.net |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
I use it all the time in my Zmachine code to "fail early" if a function or subroutine is called with unexpected parameter values. Though for performance reasons I will probably strip most of these checks out for the "release build". The fact that it has been entirely overlooked gives me some hope it is also the ultimate cause of the regular hanging behaviour I have been observing. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |