![]() |
Forum Index : Microcontroller and PC projects : MMBasic for Windows - betas
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
panky![]() Guru ![]() Joined: 02/10/2012 Location: AustraliaPosts: 1111 |
Problem with GUI CLICK(REF) Version 5.07.03b8 GUI Area #1,0,0,200,200 GUI Interrupt Mouseclick Do Loop Sub Mouseclick Print CLICK(REF) End Sub When run, gives the following error after a mouse click in the area defined in the program. Error in line 8: CLICK is not declared Testing with Ctrlval shows the mouse click is recognised and correctly returns the #ref from the GUI AREA command. Edit: Unsure about this last bit. Changing CLICK (CMM2) to TOUCH (picomite) makes no difference. What I am trying to achieve is for the GUI AREA command to return the control value assigned. D. Edited 2022-04-09 13:14 by panky ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10078 |
Try MOUSE(REF) |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Spurious trailing NULL in written file: > list "bad_file.bas" Option Base 0 Option Default None Option Explicit On Option Console Both Dim f$ = "myfile.txt" Open f$ For Output As #1 Print #1, "Hello World" Close #1 Open f$ For Append As #1 Print #1, "Goodbye World" Dim i% = Eof(#1) ' It doesn't happen if this line is omitted. Close #1 Open f$ For Input As #1 Dim s$ = Input$(255, 1) Close #1 Dim ch% For i% = 1 To Len(s$) ch% = Asc(Mid$(s$, i%, 1)) If ch% > 31 And ch% < 255 Then Print Chr$(ch%); Else Print "<" Hex$(ch%, 2) ">"; EndIf Next Print "Where did the trailing <00> come from?" > run Hello World<0D><0A>Goodbye World<0D><0A><00> Where did the trailing <00> come from? > Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10078 |
V5.07.03b9 MMBasic.zip Fixes the two bugs Tom has reported. In addition (because it was so easy) saves and restores the ON ERROR SKIP status if an interrupt happens before the offending line |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Thanks Peter, tested the first two and confirm they are fixed. Not tested the latter at this time. A regression that I think has occurred at some point in the last couple of builds: ? Day$(Now) dummy Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10078 |
Think it is a day 1 bug. Just happens to be only on Sundays. MMBasic.zip |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
An interesting one on the CMM2 - so probably the wrong thread, yet here I am ![]() > ON ERROR SKIP > OPEN "file-that-exists" FOR INPUT AS #1 > ? "*" MM.ERRMSG$ "*" *Succeeded * 1. That there is any MM.ERRMSG$ on success is a bit counter-intuitive, and means you need to be careful to check MM.ERRNO <> 0, not MM.ERRMSG$ <> "" if you are interested in handling errors. 2. The "Succeeded " message has a trailing space; irrelevant if (1) were fixed. Note that MMB4W does not set MM.ERRMSG$ on success, it would (correctly) be the empty string in this example. Also on CMM2 and MMB4W: SEEK #fnbr, pos does not report an error if pos <= 0, it probably should. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Here is an inconsistency between MMB4W and the CMM2. MMB4W: > list "append_loc_bug.bas" Option Base 0 Option Default None Option Explicit 1 Option Console Both Dim f$ = "append_loc_bug.txt" Open f$ For Output As #1 Print #1, "foo"; Close #1 Open f$ For Append As #1 Print Loc(#1) Close #1 End > run "append_loc_bug.bas" 1 > Run the same code on the CMM2 and it outputs 4 ... I think that the CMM2 is probably correct and MMB4W incorrect. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10078 |
Looks like a bug/feature in ftell/fopen. As soon as you write something it will return the correct value but it doesn't seem to set the filepointer until something is written. Don't think I can do anything about it? |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
It looks like the C specification does not specify the behaviour in this particular case and thus an implementation is free to do what it wants - Linux/GCC behaves like the CMM2. Of course if you wanted you could get MMBasic to handle it as a special case when it knows a file has been opened for APPEND - YMMV. Best wishes, Tom Edited 2022-04-12 19:08 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Kabron![]() Regular Member ![]() Joined: 30/11/2017 Location: GermanyPosts: 65 |
With any version of MMBasic I got blank window which dissapeared in about 15 seconds. Windows 10 x64 ![]() |
||||
Kabron![]() Regular Member ![]() Joined: 30/11/2017 Location: GermanyPosts: 65 |
Observed on two PC Last working version: 5.07.03pa12 Edited 2022-04-15 23:53 by Kabron |
||||
mclout999 Guru ![]() Joined: 05/07/2020 Location: United StatesPosts: 483 |
Is this just the first time you run it or every time? My antivirus(Avast) software interrupts the first run but pops up a notice that it is scanning the entire run of the code. Then It continues. Maybe your antivirus is doing the same thing but not notifying you about the run time scan like mine does. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10078 |
Windows 10 x64 See page 8 of this thread and try launching from a DOS box with MMBASIC 0 |
||||
Kabron![]() Regular Member ![]() Joined: 30/11/2017 Location: GermanyPosts: 65 |
See page 8 of this thread and try launching from a DOS box with MMBASIC 0 This works, but COPY/PASTE not work in console window. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10078 |
Correct. And it won't be |
||||
Kabron![]() Regular Member ![]() Joined: 30/11/2017 Location: GermanyPosts: 65 |
Correct. And it won't be Very discomfortable! |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Hi Peter, Pretty sure this is a bug and different from the CMM2, but I only have MMB4L to compare against at the moment: > Dim a% > Poke Var a%, 0, 255 > ? Peek(Var a%, 0) -1 Output from PEEK(VAR var, offset) should be an unsigned/byte value = 255. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10078 |
MMBasic.zip |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Thanks Peter, That issue is fixed. 1. Unfortunately this appears to be a regression from the previous build: > list "append_bug.bas" Option Console Both Dim f$ = "append.txt" On Error Skip Kill f$ Open f$ For Output As #1 Print #1, "Hello World" Close #1 Open f$ For Append As #1 ? Eof(#1) ' Works if you comment out this line Print #1, "Goodbye Peter" Close #1 > run "append_bug.bas" 0 Error in line 10: File write > 2. Also (in this and previous build) this crashes MMB4W rather than reporting a "Syntax" error Dim i% = 1 ? Peek(Var i%) 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 |