Jump to content

func inside string()


zutto
 Share

Recommended Posts

yeah.. i've been trying to figure out is it possible and how its done to have function inside string()

so far no success :<

also would like to know is it possible to get every function names/variables using string() of the code?

-zutto

Link to comment
Share on other sites

There is no way built in to AutoIt to do that. There are a few examples of UDFs that can do this. I can't find anything right now because the board's search is not very cooperative.

hmh k..

is there way to even use #include ?

Link to comment
Share on other sites

#include is only for compile time access to code. It is not for loading code while running.

That may be true (and screwdrivers are not meant to be chisels :-), but #include should do what the OP wants - or at least what I think that the OP wants.....

Post #3 by the OP indicates that there is some need/value in reading info from a file and having that info be a function. Just putting the function in that file and using #include should work. If the file is built dynamically by the script calling it, then the script would need to restart itself or launch a child to read and act upon the file/UDF.

...or do I have it all wrong?

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

You could rerun the script but that sounds really messy. You'd have to have a plaintext copy of the script for executing like that.

Messy - yes, but the main script can be compiled and the include would be text that was dynamically written by the main based on some data that it found during each run.

Not terribly practical/useful - but neither is this thread without clarification from the OP :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

  • Moderators

Or make them just separate functions for each file that are stand alone and don't rely on anything other than a command line var or so... and use AutoIt3ExecuteLine or AutoIt3ExecuteScript.

Call() could be used if designed properly, even the function Execute() will give moderately successful results if used appropriately.

So yes, there are means built in to accomplish executing code from a text file or a string.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...