' Thread Create — THREAD CREATE basic
#COMPILE EXE
#DIM ALL

FUNCTION ThreadWorker(BYVAL lParam AS LONG) AS LONG
    PRINT "Thread running with param: " + STR$(lParam)
    FUNCTION = lParam
END FUNCTION

FUNCTION PBMAIN() AS LONG
    LOCAL hThread AS LONG
    THREAD CREATE ThreadWorker(42) TO hThread
    PRINT "Main thread continuing..."
    THREAD CLOSE hThread
    FUNCTION = 0
END FUNCTION
