"could be" as in, when you stick to those points I mentioned.
So I don't need a loop for each function?
nope.
Blitz+ events work as follow:
step 1: Wait for an event, if there's NO event, then NOTHING happens, your program is doing nothing, standing still, being idle.
step 2: After an event of any kind occured then all the relevant ID, SOURCE, DATA, X, Y etc. fields are filled. These are global variables, so you can read them out anywhere
step 3: Jump to your functions to see which events have been triggered and act according to it. Ofcourse, functions are not mandatory, but stuffing your whole application in your main loops is a bad idea.
repeat these 3 steps.
What it looks like in code:
So I don't need a loop for each function?
nope.
Blitz+ events work as follow:
step 1: Wait for an event, if there's NO event, then NOTHING happens, your program is doing nothing, standing still, being idle.
step 2: After an event of any kind occured then all the relevant ID, SOURCE, DATA, X, Y etc. fields are filled. These are global variables, so you can read them out anywhere
step 3: Jump to your functions to see which events have been triggered and act according to it. Ofcourse, functions are not mandatory, but stuffing your whole application in your main loops is a bad idea.
repeat these 3 steps.
What it looks like in code:
Repeat Waitevent() ; <- Here it waits, if nothing happens then the program counter is still here, and nowhere else. ; obviously something happened, so we continue DoThis() DoThat() If EventID()=$803 quit=1 Until quit Function DoThis() ; right here you can read out all the events you want ; You don't have to WaitEvent() here, because there's no need to wait, the reason you're here is because an Event has already occurred. It's in the global Event variables. End Function Function DoThis() ; right here you can read out all the events you want ; You don't have to WaitEvent() here, because there's no need to wait, the reason you're here is because an Event has already occurred. It's in the global Event variables. Function etc.