;
; ------------------------------------------------------------
;
; PureBasic - Thread example file
;
; (c) Fantaisie Software
;
; ------------------------------------------------------------
;
Global thread
Procedure AlertThread(Parameter)
Repeat
Debug "Alert ! "+Str(Parameter)
Delay(3000)
Parameter-1
If Parameter = 147
KillThread(thread)
EndIf
ForEver
EndProcedure
thread = CreateThread(@AlertThread(), 154)
; MessageRequester("Info", "It will display an alert every 3 seconds."+#LF$+"Click To kill the alerts", 0)
; KillThread(thread)
MessageRequester("Info", "Click To finish the program", 0)
I am considering use of threads, but I want the thread to die after it completes it's task.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Nothing is faster, more stable, or easier to maintain than code that doesn’t exist.