AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

NewThread call to it give the script's default settings

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
infogulch



Joined: 27 Mar 2008
Posts: 130
Location: KC, MO

PostPosted: Tue May 27, 2008 10:55 pm    Post subject: NewThread call to it give the script's default settings Reply with quote

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 Wink 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.
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group