Jump to content

Help With #include

Recommended Posts

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

Link to comment
Share on other sites

  • Developers

What do you want to do with the information from this file ?

Is it data or just another script ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
Live for the present,
Dream of the future,
Learn from the past.

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


; 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.

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

  • Recently Browsing   0 members

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