#MaxThreads

Sets the maximum number of simultaneous threads.

#MaxThreads Value

 

Parameters

Value The maximum total number of threads that can exist simultaneously (limit 20).

 

Remarks

This setting is global, meaning that it needs to be specified only once (anywhere in the script) to affect the behavior of the entire script.

Although a value of 1 is allowed, it is not recommended because it would prevent new hotkeys from launching whenever the script is displaying a MsgBox or other dialog.

Any hotkey subroutine whose first line is ExitApp, Pause, Edit, Reload, KeyHistory, ListLines, ListVars, or ListHotkeys will always run regardless of this setting.

If this setting is lower than #MaxThreadsPerHotkey, it effectively overrides that setting.

If this directive is unspecified in the script, it will behave as though set to 10.

 

Related

#MaxThreadsPerHotkey, Threads, #MaxHotkeysPerInterval, #HotkeyInterval, ListHotkeys, #MaxMem

 

Example

#MaxThreads 2