Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : MMBasic: are there any interrupts with arguments ?
Author | Message | ||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4036 |
Hi folks, I can't find one, but I thought I'd check are there any MMBasic commands that use an interrupt routine with an argument ? I ask because MMB4L will have a command thus: GRAPHICS WINDOW id, x, y, w, h [, interrupt] And when the interrupt is called (due to a Window event such as the user clicking [x] to close it) it will need to receive as a minimum the window 'id' and a value indicating what type of event occurred. e.g. Sub my_interrupt(id As Integer, type As Integer) ... End Sub Best wishes, Tom Edited 2024-05-01 04:55 by thwill Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9110 |
No: and I can't immediately see how it would work. MUCH easier would be a MMBasic defined variable. |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4036 |
I agree, but that isn't as powerful or scalable so I think it is worth my having a punt at implementing it ... not that it looks easy, the way that interrupt SUBs are called is already a bit "unusual". Best wishes, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4036 |
Done . Pretty straightforward, but writing and robustly testing new* code to parse FUNCTION/SUB signatures was time consuming. * Obviously MMBasic could already do this (see DefinedSubFun() in the source) but it does so in conjunction with parsing the line making the FUNCTION/SUB call. I didn't have such a line to to parse; though faking such was an alternative implementation I considered but discounted as it being more likely "there be dragons". Onwards and upwards, Tom Edited 2024-05-05 22:12 by thwill Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
LeoNicolas Guru Joined: 07/10/2020 Location: CanadaPosts: 479 |
This is cool. Can you share the commit link? I'm curious to see what you came with. |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4036 |
Hi Leo, I'm not sure about "cool", I was more thinking "very niche" . This is all on the development branch for MMB4L v0.7.0: https://github.com/thwill1000/mmb4l/tree/develop-0.7.0 And the commits in question are: Add parse_fn_sig() to parse FUNCTION/SUB signatures Add optional interrupt param to GRAPHICS WINDOW CLOSE WARNING! This is not a stable branch and I'm the only contributor to it, as such I'm engaged in interactive rebases and other horrors. If you know git then you know what I mean, if you don't then it's unlikely to bother you too much . Best wishes, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Print this page |