zutto Posted August 24, 2009 Share Posted August 24, 2009 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 More sharing options...
Richard Robertson Posted August 24, 2009 Share Posted August 24, 2009 Do you mean that you want to hold the code for a function inside a string variable, and then execute that function? Link to comment Share on other sites More sharing options...
zutto Posted August 24, 2009 Author Share Posted August 24, 2009 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 >_< Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 24, 2009 Share Posted August 24, 2009 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. Link to comment Share on other sites More sharing options...
zutto Posted August 24, 2009 Author Share Posted August 24, 2009 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 More sharing options...
Richard Robertson Posted August 25, 2009 Share Posted August 25, 2009 #include is only for compile time access to code. It is not for loading code while running. Link to comment Share on other sites More sharing options...
billthecreator Posted August 25, 2009 Share Posted August 25, 2009 try using Call() Call($FuntionReadFromFile) maybe that will work [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
herewasplato Posted August 25, 2009 Share Posted August 25, 2009 #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 More sharing options...
Richard Robertson Posted August 25, 2009 Share Posted August 25, 2009 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. Link to comment Share on other sites More sharing options...
herewasplato Posted August 25, 2009 Share Posted August 25, 2009 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 More sharing options...
Moderators SmOke_N Posted August 25, 2009 Moderators Share Posted August 25, 2009 (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 August 25, 2009 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 More sharing options...
zutto Posted August 25, 2009 Author Share Posted August 25, 2009 Thank you for all the answers i'll be trying to survive with things i can do >_< Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now