Sign in to follow this  
Followers 0
zCoCoz

Help With #include

4 posts in this topic

i need help im trying to make a script and right in the middle of it you type in a file and the script will read it and use it like an include but i cant figure out how to do it because you cant use #include with a variable

Share this post


Link to post
Share on other sites



If you want it to read and process data, you could do an INI file, or you could have it filereadline data in.

If you want it to read in autoitscript, then you can have autoit create an autoit file that includes the code and run that.

ex:

; bunch of stuff before this
FileDelete (@TempDir & "\foo.au3")
FileWriteLine (@TempDir & "\foo.au3", "#include " & $x)
FileWriteLine (@TempDir & "\foo.au3", "msgbox(1,'included file'," & $x & ")" )

RunWait("C:\Program Files\AutoIt3\AutoIt3.exe " & '"foo.au3"', @TempDir)
; rest of script, you could do a filereadline loop to grab and insert if you like as well.

Compiled EXEs have to have all the script they will execute before hand, but you could even include the autoit.exe in your script and execute it that way.

More than one way to skin a cat....


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

thanks it works now :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