| View previous topic :: View next topic |
| Author |
Message |
silkcom
Joined: 23 Jan 2008 Posts: 162
|
Posted: Fri Mar 13, 2009 10:53 pm Post subject: Getting list of subs |
|
|
| Is it possible to dynamically get a list of Sub's in a given program. |
|
| Back to top |
|
 |
Frankie
Joined: 02 Nov 2008 Posts: 2850
|
Posted: Sat Mar 14, 2009 2:12 am Post subject: |
|
|
Yes with grep(). I couldn't quite get it due to my RegEx skills (or lack of). _________________ aboutscript ⍟ apps ⍟ scripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run |
|
| Back to top |
|
 |
Slanter
Joined: 28 May 2008 Posts: 739 Location: Minnesota, USA
|
Posted: Sat Mar 14, 2009 5:01 am Post subject: |
|
|
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 |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
|
| Back to top |
|
 |
silkcom-offline Guest
|
Posted: Mon Mar 16, 2009 12:16 am Post subject: |
|
|
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 |
|
 |
|