infogulch
Joined: 27 Mar 2008 Posts: 130 Location: KC, MO
|
Posted: Tue May 27, 2008 10:55 pm Post subject: NewThread call to it give the script's default settings |
|
|
What it would do is give the call the script defaults of settings (instead of the thread's current settings), and not pass a setting made by it back to the caller. Functions called this way could still give return expressions and not worry about changing settings back to the thread's.
I've thought of different ways of using it, but can't think of anything universally good. Labels could be: "NewGosub" or "GosubNew" etc. but function calls would be harder. Maybe a set prefix for both labels and functions would automatically make it use a new thread's options. E.g.:
| Code: | GoSub A_NewThread_MyLabel
ReturnInfo := A_NewThread_MyFunc(1,2)
; unnedded: SetFormat, Integer, d
; unnedded: DetectHiddenWindows, Off
WinGet, WindowList, List ;uses default hiddenwindows settings for this command
A := ReturnInfo + 20 ;uses default integer format D
return
MyLabel:
DetectHiddenWindows, On
WinGet, WinList, List
; Do stuff
reutrn
MyFunc( a, b )
{
SetFormat, Integer, hex
return a+b
} |
It's not the best example, but something like this would eliminate much setting, saving, and resetting script settings. (say that 10 times fast lol) And, since labels would (probably) be easier to call with a new thread (By GoSubNew, GoToNew, etc. & No returning of expressions), maybe just implementing them first (or at all) would be better. _________________
 |
|