AutoHotkey Community

It is currently May 27th, 2012, 12:29 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: June 16th, 2005, 1:14 pm 
Offline

Joined: June 1st, 2005, 11:09 am
Posts: 54
Location: Scotland
This is either "wish I could do that" or "how do I do that". I currently am interested in having my script take a variable containing the name of an AutoHotkey function I've written, or perhaps containing the name of an ordinary program code label, and execute that function or executing GOSUB or GOTO on the label.

Currently I have a program that goes,
Code:
   IfEqual, AnyKey, %ApoKey101_11%
               Apo_Continue := ApoFn_101_11()
Else   IfEqual, AnyKey, %ApoKey102_11%
               Apo_Continue := ApoFn_102_11()
Else   IfEqual, AnyKey, %ApoKey103_11%
               Apo_Continue := ApoFn_103_11()
Else   IfEqual, AnyKey, %ApoKey104_11%
               Apo_Continue := ApoFn_104_11()
...

for around 87 kilobytes. I think I'd do better with some array addressing and one of the InStr functions. I also intend that the contents of the ApoKeyN_N array are arbitrary, but I guess I could sort 'em. This is where I'd prefer database commands, but scripting isn't for purists. ;-)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 16th, 2005, 2:09 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
You can dynamically call a label (but not a function yet). For example:

Var = MyLabel
Gosub %Var%


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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