![]() |
Forum Index : Microcontroller and PC projects : CMM2 5.05.06 beta
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4301 |
And now for something completely different ... A bit of strangeness with TRACE LIST: > Colour Maximite 2 MMBasic Version 5.05.05 Copyright 2011-2020 Geoff Graham Copyright 2016-2020 Peter Mather > list "hello.bas" Print "Hello World" > trace list > run "hello.bas" Hello World > trace list [1] > run "hello.bas" Hello World > trace list [1] [1] > run "hello.bas" Hello World > trace list [1] [1] [1] > new > trace list > run "hello.bas" Hello World > trace list [1] [1] [1] [1] My expectation was that the list would emptied on a NEW or a RUN. Also note the weird behaviour of NEW where it appears to clear the list, until you then RUN at which point all the previous entries reappear. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4301 |
And how about this joyous fragment: > list "gosub.bas" Trace On Print "a" : Gosub foo : Print "c" End foo: Print "d" Return > run "gosub.bas" [a [4][5]d [6]c [3] I believe the correct output would be: [2]a [4][5]d [6]c [3] Though this would be even better: [2]a [4][5]d [6][2]c [3] Note that I don't write code like this, but sometimes I have to port it. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
mkopack73 Senior Member ![]() Joined: 03/07/2020 Location: United StatesPosts: 261 |
I thought gosub and return were deprecated? |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4301 |
That doesn't mean they aren't supported for backward compatibility. In any case, the issue with TRACE isn't GOSUB dependent: > list "trace_bug.bas" Trace On Print "a" : foo() : Print "c" End Sub foo() Print "d" End Sub > run "trace_bug.bas" [a [5]d [6]c [3] Whereas the output I would ideally expect would be: [2]a [4][5]d [6][2]c [3] Though it would be acceptable w/out the [4] and/or second appearance of [2]. Best wishes, Tom Edited 2020-09-13 00:06 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10209 |
VBA |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10209 |
As in my previous comment - libraries should always use, assume, and mandate defaults. This is the only sensible way to work. No-one needs to use any of the options in non-default modes so it is up to them to work with defaults if they wish to use libraries Thwill, I'll fix the trace issue in the next beta. No version of MMBasic zeroes the trace list, not sure why. Will see if it can be changed without causing problems Edited 2020-09-13 03:33 by matherp |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4301 |
Thanks Peter no urgency, just reporting the issue because I noticed and could reproduce it. What about the strange behaviour with the list when you NEW ? It appears to zero it, and then as soon as you RUN the old entries are back! Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
capsikin Guru ![]() Joined: 30/06/2020 Location: AustraliaPosts: 341 |
Not sure if this is a bug, but it was unexpected: If I change font, then do "list" to list the program, the font changes back at the end of the listing. editing to add: this is at the command line. Edited 2020-09-13 14:57 by capsikin |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
Hi Peter, I'm not sure if you saw VegiPete reporting that a stray ")" after a PIXEL statement didn't generate an error but I've just seen a "For column = 0 to 40)" not generate one either (Version 5.05.05) Cheers, Andrew |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10209 |
In general MMbasic does not check for junk after the end of a valid statement. It is capable of doing this but adds processor overhead. This is not specific to the CMM2. Since it is benign it is probably best left as-is. |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
Thanks Peter, Cheers, Andrew |
||||
capsikin Guru ![]() Joined: 30/06/2020 Location: AustraliaPosts: 341 |
This is a tricky one, but I'd better report it. I'm getting the error "Not enough heap memory". Based on past memory, if I turn the computer off and on the error will go away and it will be hard to track down, so I did some more testing first. Testing, stage 1: I'd been using the computer for a while, and now I can trigger the error by editing my 88 line program, pressing Ctrl-F to find, and typing a single character to search for. The program also includes a 93 line font include file. after the error, I'm trying typing "memory" Program: 9K ( 1%) Program 153 lines 3K ( 0%) 1 Embedded Fonts 504K (99%) Free Data: 0K ( 0%) 0 Variables 0K ( 0%) General) 5184K (100%) Free I get the same error searching in a new 6 line or 1 line file. I saved a 1 line file, then edited it and searched, and the search status line moved up the screen, and the command line status line appeared at the bottom of the screen. If I enter the command cls, it's back to normal at the command line. (edit: this may have been because the system was even lower on emory, rather than because it was a saved single line file) Testing, stage 2: With other errors, e.g. if I enter "print 4/0" or "asdf", I lose the cursor until I enter cls, and don't get a normal error message showing. If I save mm.info(hpos) and mm.info(vpos) to variables while I've lost the cursor, I find mm.info(hpos)=0 and mm.info(vpos)=-384 Trying again, I find if I press Enter a few dozen times when the cursor is lost, it does come back on screen. Hmm, I edited a file, searched, and it seemed to lock up. Testing, stage 3: Ctrl-C, Esc, and entering cls, do not help. At this point I did turn it off and on, and can't reproduce the problem. I suspect once the editor is crashing due to not having enough heap memory, it is leaking even more memory, until it can't give error messages, and once MMBASIC can't give error messages, further errors may be leaking more memory until the system hangs. But I don't know what's causing the initial low memory problem. Is there a way to check how much heap is available - it seemed like there was plenty of memory for basic programs? |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10209 |
Thanks - I think ![]() mm.info(heap) What about NEW ? Any non-standard option settings? Edited 2020-09-13 22:37 by matherp |
||||
capsikin Guru ![]() Joined: 30/06/2020 Location: AustraliaPosts: 341 |
Thanks, that should be helpful. What about NEW ? Any non-standard option settings? I might try "NEW" next time. Do you mean after it had apparently hung, or as a way to recover memory earlier? No nonstandard options, I hadn't even set my keyboard yet. |
||||
mkopack73 Senior Member ![]() Joined: 03/07/2020 Location: United StatesPosts: 261 |
Thanks - I think ![]() mm.info(heap) Thanks, that should be helpful. What about NEW ? Any non-standard option settings? I might try "NEW" next time. Do you mean after it had apparently hung, or as a way to recover memory earlier? No nonstandard options, I hadn't even set my keyboard yet. Hmm, starting to wonder if that shouldn't be a standard thing to put at the top of every program... (NEW that is...) Might make for the safest situation all the time. Same with END at the bottom... I know the system will work just fine without them 99% of the time, but might be good practice to always use those even if they aren't explicitly required. Edited 2020-09-14 00:39 by mkopack73 |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10209 |
New deletes the current program - not a good idea in a program ![]() |
||||
mkopack73 Senior Member ![]() Joined: 03/07/2020 Location: United StatesPosts: 261 |
New deletes the current program - not a good idea in a program ![]() Oh crap. that's right. For some reason I was thinking that just erased the values in the symbol table... I was thinking of "clear" ok, nevermind! Edited 2020-09-14 00:46 by mkopack73 |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10209 |
V5.05.06b5 posted http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip Bug fixes: Fixes bugs in TRACE and TRACE LIST when multiple commands separated by colons are on a line Clears OPTION ANGLE to default before running a program Misalignment in Font 5 fixed - thanks Jim New Features: OPTION Y_AXIS should now work for all drawing commands including print, loading images and sprites - or at least it does for the tests I've conducted. TRACE is cleaned at the start of a program General comments: Whether rightly or wrongly this is expected behaviour Page up and Page down should be completely ignored in selection mode. I can't make them lose the selection. The paging code it too complex to allow in selection mode so it won't be added. Temporary options are stored as normal variables and are not in the permanent option table. I will review including a general interrogation mechanism at a later date This would be a YAN (yet another option) which you would want to be permanent with little utility except for a tiny user base so sorry - no Edited 2020-09-14 03:59 by matherp |
||||
elk1984![]() Senior Member ![]() Joined: 11/07/2020 Location: United KingdomPosts: 228 |
I don't know if this is intentional, but Up and Down arrows to navigate through previous commands doesn't work if you start typing a command then delete all the content. Starting a new line, Up and Down work as normal. |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4301 |
Thanks Peter, I believe the behaviour of TRACE LIST is still not quite 100%, see the following, starting with a reset: > Colour Maximite 2 MMBasic Version 5.05.06b5 Copyright 2011-2020 Geoff Graham Copyright 2016-2020 Peter Mather > list "hello.bas" Print "Hello World" > run "hello.bas" Hello World > trace list [1] [1] 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 |