This simple example will execute wait_alarm every two seconds.
Code: Select all
Declare Function Signal cdecl alias "signal" (ByVal V_Signal As long, byval V_Function As Any Ptr) as Any Ptr
declare function alarm cdecl alias "alarm" (byval __seconds as uinteger) as uinteger
sub wait_alarm(isignal as integer)
?"This is the scheduled event"
alarm(2) 'loads another alarm events: each alarm event is a single time event, so to repeat it it must be set again every time
alarm(2) 'the alarm event is triggered after 2 seconds
for i as integer=1 to 10
It works perfectly on Linux and Dos. On Windows, it might not work if the MingW version used doesn't support signals