Thread.ThreadState

From Xojo Documentation

Read-Only Property (As Thread.ThreadStates )
Thread.ThreadStatesValue = aThread.ThreadState

New in 2019r2

Supported for all project types and targets.

Indicates the state of the thread.

Notes

A thread can be in one of five states. See Thread.ThreadStates for details.

Sample Code

This window method checks the State of the thread and displays a message in a TextField on the form. The parameter is:

State As Thread.ThreadStates
Select Case State
Case Thread.ThreadStates.Running
TextField1.Value = "Running"
Case Thread.ThreadStates.Waiting
TextField1.Value = "Waiting"
Case Thread.ThreadStates.Sleeping
TextField1.Value = "Sleeping"
Case Thread.ThreadStates.Paused
TextField1.Value = "Paused"
Case Thread.ThreadStates.NotRunning
TextField1.Value = "Not Running"
End Select