Basically I have a program which, among other things, registers an event listener with:
event.listen("modem_message",move)
I would like it to only respond once to receiving a message, but unfortunately each time I run the program it registers a 'new' listener, so it runs 'move' multiple times. So I tried to set it to unregister the listener at the start of the program, using:
event.ignore("modem_message",move)
But this doesn't work, seemingly because the current definition of 'move' is treated as different to the definition which was registered as a listener. So how would I go about removing the registered listener?
p.s. I'm currently rebooting the computer each time I need to rerun the program, which is mostly when I change the definition of move, but this is rather annoying.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Basically I have a program which, among other things, registers an event listener with:
I would like it to only respond once to receiving a message, but unfortunately each time I run the program it registers a 'new' listener, so it runs 'move' multiple times. So I tried to set it to unregister the listener at the start of the program, using:
But this doesn't work, seemingly because the current definition of 'move' is treated as different to the definition which was registered as a listener. So how would I go about removing the registered listener?
p.s. I'm currently rebooting the computer each time I need to rerun the program, which is mostly when I change the definition of move, but this is rather annoying.
Link to post
Share on other sites