Sign in to follow this  
Followers 0
paz

Getting a list of defined functions at runtime

4 posts in this topic

Hi there,

I searched a lot in the help file / a bit on the forum, and I wonder if it can be done...

Is there any ways of getting a list of the defined functions of a script at runtime?

Take this bogus script as an example:

$func_list = GetMyFuncs()

Func Fubar($p1, $p2)

(...)

EndFunc

Of course, GetMyFuncs() doesn't exist - but is there any UDF able to do in sort that $func_list would contain something like "Fubar($p1, $p2)"

Thanks!

Share this post


Link to post
Share on other sites



Hi there,

I searched a lot in the help file / a bit on the forum, and I wonder if it can be done...

Is there any ways of getting a list of the defined functions of a script at runtime?

Take this bogus script as an example:

$func_list = GetMyFuncs()

Func Fubar($p1, $p2)

(...)

EndFunc

Of course, GetMyFuncs() doesn't exist - but is there any UDF able to do in sort that $func_list would contain something like "Fubar($p1, $p2)"

Thanks!

I am lost why this would be useful but I am sure you can tell us .. :whistle:


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

What would be the use - he he he, I was a bit expecting this ;-)

I'm totally aware that this kind of functionnality would not be used to a great extend... but I can explain what is my own goal.

See, I start using AutoIT more and more theses days, mostly to build Oracle utilities, to perform very specific queries and do a lot of reporting directly in Excel.

I use a script of my creation to convert SQL code into AU3 files, so I can "embed" SQL queries in my AutoIT executables.

In my case, theses AutoIT functions all start with the "SQL_" prefix.

As a "recovery" option, I'd like to be able to "dump" the embedded SQL code back to text files.

What I have in mind is to have my executables respond to a secret command-line option... So the executable can build a list of it's internal functions, and "call" all the ones starting with "SQL_" to write the SQL queries back to text files.

If I could write a single function doing that, without having to hardcode the actual "SQL_" functions to retreive in each utilities, that would be great :-)

I'm just asking - I certainly can live without this... but I might think of other uses :whistle:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0