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 

AutoHotkey_L: Arrays, Debugger, x64, COM, #If expression ...
Goto page Previous  1, 2, 3, 4 ... 68, 69, 70  Next
 
This topic is locked: you cannot edit posts or make replies.    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Krogdor



Joined: 18 Apr 2008
Posts: 1390
Location: The Interwebs

PostPosted: Tue Aug 12, 2008 3:46 am    Post subject: Reply with quote

A question about #If (expression)
Is there a way to use this for dynamic hotkeys as well? For example:

Code:
Hotkey, If (expression)
;would be to
#If (expression)
;as
Hotkey, IfWinActive, somewindow
;is to
#IfWinActive, somewindow
Back to top
View user's profile Send private message AIM Address
Lexikos



Joined: 17 Oct 2006
Posts: 7299
Location: Australia

PostPosted: Tue Aug 12, 2008 8:03 am    Post subject: Reply with quote

I forgot to document the following:

Use Hotkey, If, Expression to modify or create hotkey variants under an existing #If, Expression. For example:
Code:
Hotkey, If, Expression
;is to
#If, Expression
;as
Hotkey, IfWinActive, somewindow
;is to
#IfWinActive, somewindow
The comma is optional for #If, but required for Hotkey, If. Expression must match an existing #If, Expression exactly, including case but excluding trailing or leading spaces or tabs. ErrorLevel is set to 1 if it does not exist somewhere in the script.

(The ability to create new #If expressions with the Hotkey command is planned.)
Back to top
View user's profile Send private message Visit poster's website
Krogdor



Joined: 18 Apr 2008
Posts: 1390
Location: The Interwebs

PostPosted: Tue Aug 12, 2008 8:14 am    Post subject: Reply with quote

Aha!

Great, thanks Lexikos.

Also, just for clarification—the #If expression just has to be declared somewhere in the script, but it doesn't have to be the one directly before the Hotkey, If command, right? For example:

Code:
#If, expression1
Enter:: MsgBox
#If, expression2
G:: MsgBox
Hotkey, If, expression1


is valid?
Back to top
View user's profile Send private message AIM Address
Lexikos



Joined: 17 Oct 2006
Posts: 7299
Location: Australia

PostPosted: Tue Aug 12, 2008 8:45 am    Post subject: Reply with quote

Code:
G:: MsgBox
This is a single-line hotkey, which will not execute the line below it. Other than that, your example should work. The #If expression can be anywhere in any file #included in the current script.
Back to top
View user's profile Send private message Visit poster's website
Krogdor



Joined: 18 Apr 2008
Posts: 1390
Location: The Interwebs

PostPosted: Tue Aug 12, 2008 5:00 pm    Post subject: Reply with quote

Okay, thanks for the help.

And I know that the Hotkey, If would never get activated in that example, I just wanted to show an example of an order of #If's and Hotkey, Ifs.

Can't wait to see more of your planned list implemented Very Happy
Back to top
View user's profile Send private message AIM Address
Guest






PostPosted: Thu Aug 14, 2008 7:19 am    Post subject: Reply with quote

way AWSOME and GREAT Lexikos!!! thank you SO much!!!

is there any way that we can get an alternate extension ie .ahl and a slightly different tray icon (like the olive-color A one)?
i'd like to run both versions for now - and since your version will run "regular" scripts but not visa-versa...
Back to top
Guest






PostPosted: Thu Aug 14, 2008 8:13 am    Post subject: Reply with quote

i just opened test.ahl with your version and it's running just fine - don't know how or why. so that just leaves the tray icon...
Back to top
Krogdor



Joined: 18 Apr 2008
Posts: 1390
Location: The Interwebs

PostPosted: Thu Aug 14, 2008 8:52 am    Post subject: Reply with quote

There shouldn't be any reason why Lexikos's version wouldn't work with scripts made in normal AHK—it simply adds more features and optimizes some current ones, so there is no reason why older scripts wouldn't function with it.

Edit: Oops, misread what you wrote. My bad!

Anonymous wrote:
i just opened test.ahl with your version and it's running just fine - don't know how or why.

Is there a reason why you think it wouldn't? Autohotkey scripts are just text files, so the extension doesn't really matter as far as I know.
Back to top
View user's profile Send private message AIM Address
philz



Joined: 05 Jun 2007
Posts: 89
Location: USA

PostPosted: Mon Aug 18, 2008 11:04 am    Post subject: Reply with quote

So are there any plans to merge lexikos' custom build with the official AutoHotkey build?
Back to top
View user's profile Send private message Send e-mail
Lexikos



Joined: 17 Oct 2006
Posts: 7299
Location: Australia

PostPosted: Mon Aug 18, 2008 11:35 am    Post subject: Reply with quote

Guest,
ResHacker is the simplest way to change the icons, from a user standpoint.

philz,
No. Since Chris' priorities are different than my own, my build will always be separate. Some features may make it to the official build, however. After discussing briefly with Chris, I think the following are likely candidates:
  • Assume-static.
  • Flexibility in dynamic function calls, despite the loss of some error-detection ability.
  • #If, despite the potential for input lag.
  • While, especially after I implement Do..While.

I am currently working on debugging features in the form of DBGp support. The initial release will likely only support the simplest of clients (a modified XDebugClient), with simple breakpoints, step in, step out and step over.
Back to top
View user's profile Send private message Visit poster's website
JoeSchmoe



Joined: 17 Feb 2008
Posts: 303

PostPosted: Mon Aug 18, 2008 8:30 pm    Post subject: This looks great! Reply with quote

Thanks so much for sharing your build us! some of these features look very helpful!
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Aug 18, 2008 10:29 pm    Post subject: Reply with quote

Lexikos wrote:
especially after I implement Do..While.

who want Do..While?
Back to top
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Thu Aug 21, 2008 2:19 am    Post subject: Reply with quote

Lexikos wrote:
Revision 7 - July 26, 2008
  • Added: IsFunc(FuncName) - Returns a non-zero number if FuncName exists in the script or as a built-in function.

How about IsFunc() returning the address of a function than 1? Or is there a way to get it without using RegisterCallback and NumGet?
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 7299
Location: Australia

PostPosted: Thu Aug 21, 2008 8:41 am    Post subject: Reply with quote

There is a reason I worded it as "a non-zero number." Smile Logically it should return a boolean value, but I see more benefit than harm, so I'll add it in the next commit.
Back to top
View user's profile Send private message Visit poster's website
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Thu Aug 21, 2008 2:11 pm    Post subject: Reply with quote

Lexikos wrote:
There is a reason I worded it as "a non-zero number." Smile
Yes, that led me to have expected a function pointer. Wink
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies.    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4 ... 68, 69, 70  Next
Page 3 of 70

 
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