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 

Getting list of subs

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
silkcom



Joined: 23 Jan 2008
Posts: 162

PostPosted: Fri Mar 13, 2009 10:53 pm    Post subject: Getting list of subs Reply with quote

Is it possible to dynamically get a list of Sub's in a given program.
Back to top
View user's profile Send private message
Frankie



Joined: 02 Nov 2008
Posts: 2850

PostPosted: Sat Mar 14, 2009 2:12 am    Post subject: Reply with quote

Yes with grep(). I couldn't quite get it due to my RegEx skills (or lack of).
_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run
Back to top
View user's profile Send private message
Slanter



Joined: 28 May 2008
Posts: 739
Location: Minnesota, USA

PostPosted: Sat Mar 14, 2009 5:01 am    Post subject: Reply with quote

Only did a little bit of testing, but this should do it I think
Code:
FileRead, dat, AHK.ahk
Sub = 0
While (Sub := RegExMatch(dat, "m)^(.*?)(?<!:):\s*(;.*?)?$", Str, Sub + 1))
   MsgBox % Str1

_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message Visit poster's website
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Sat Mar 14, 2009 5:03 am    Post subject: Reply with quote

Your question isn't very clear to me. Are you looking for a coding helper such as one of these?

1. TillaGoto - Go to functions, labels & hks in your script
2. List functions (+ labels + hotstuff) in an AutoHotkey script
3. PSPad Label Helper - display a list of labels found in PSPad
4. Coding helper - Jump to any label of function.
Back to top
View user's profile Send private message Visit poster's website
silkcom-offline
Guest





PostPosted: Mon Mar 16, 2009 12:16 am    Post subject: Reply with quote

slanter - lol, I didn't think of doing it that way. great idea.

tnx.

That's exactly what I was looking for. I constantly am adding functions (subs) to a program of mine, and have a little hotkey that allows me to pick one to run, and I want them to all be in the list (without having to add them each time).
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help 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