Show / Hide Table of Contents

ThreadNum


General System Function

Logic is executed by a thread assigned a unique number. The ThreadNum function returns the thread number that called the function. This function is most useful in conjunction with the If Then and Debug statements to bring up the debugger at a certain process.

Syntax

ThreadNum()

Syntaxt Example

If ThreadNum()=215 Then 
{
    Debug
}

Remarks

Note that if the model does not change between simulation runs, every thread has the same number from run to run, but not from replication to replication. Also, most changes in a model cause threads to have different numbers on subsequent runs.

In This Article
Back to top Generated by DocFX