Sign in to follow this  
Followers 0
zutto

func inside string()

12 posts in this topic

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

Share this post


Link to post
Share on other sites



Do you mean that you want to hold the code for a function inside a string variable, and then execute that function?

Share this post


Link to post
Share on other sites

basicly i am having normal autoit code

and then i am reading from file that string thing

i am trying to figure way to make it 'normal' function with only string >_<

Share this post


Link to post
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.

Share this post


Link to post
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 ?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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]

Share this post


Link to post
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.

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

Thank you for all the answers

i'll be trying to survive with things i can do >_<

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