AutoHotkey Community

It is currently May 26th, 2012, 10:35 am

All times are UTC [ DST ]




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1036 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 70  Next
Author Message
 Post subject:
PostPosted: August 12th, 2008, 4:46 am 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 12th, 2008, 9:03 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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.)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 12th, 2008, 9:14 am 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 12th, 2008, 9:45 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 12th, 2008, 6:00 pm 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
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 :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 8:19 am 
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...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 9:13 am 
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...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 9:52 am 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 18th, 2008, 12:04 pm 
Offline

Joined: June 5th, 2007, 10:57 pm
Posts: 89
Location: USA
So are there any plans to merge lexikos' custom build with the official AutoHotkey build?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 18th, 2008, 12:35 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: This looks great!
PostPosted: August 18th, 2008, 9:30 pm 
Offline

Joined: February 17th, 2008, 5:01 pm
Posts: 303
Thanks so much for sharing your build us! some of these features look very helpful!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 18th, 2008, 11:29 pm 
Lexikos wrote:
especially after I implement Do..While.

who want Do..While?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2008, 3:19 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2008, 9:41 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
There is a reason I worded it as "a non-zero number." :) Logically it should return a boolean value, but I see more benefit than harm, so I'll add it in the next commit.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 21st, 2008, 3:11 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Lexikos wrote:
There is a reason I worded it as "a non-zero number." :)
Yes, that led me to have expected a function pointer. ;)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1036 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 70  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher and 0 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group