Get run-time options

Syntax

int getopt(option [context])

 

Parts

option - one of options that can be set with opt, or one of options listed below.

speed macro speed (autodelay) in milliseconds. Speed can be set globally (in Options dialog) and locally (spe).
itemid item id
nargs number of arguments passed. Can be used in a function to know which optional arguments were omitted.
nthreads number of threads currently running. This does not include special threads. If context is 4, returns total number of running threads. Otherwise, returns number of threads started by function defined by context.

context - one of values listed below. Default: 0.

0 return options of current item (item from which is called this function).
1 return options of caller (if current item is function and it is called from another item).
2 return options of callback entry function or thread entry function.
3 return options of thread entry function (macro or function that started execution).
4 return global options. Valid only for speed and nthreads.

 

Remarks

Returns 0 if the option is unavailable in the specified context.

 

QM 2.2.1. Added slowmouse, slowkeys, keymark, keysync.

QM 2.3.0. Added hungwindow.

 

Examples

 show number of arguments: 
int na=getopt(nargs)
out na

 show name of current item:
_s.getmacro(getopt(itemid) 1)
out _s