Jump to content

Runtime Includes


Recommended Posts

  • Developers

Is there a way to #include files or functions at runtime. Something like the following:

<code>

InetGet("http://myserver.com/au3.pl", "c:\mytest.au3", 1)

#include "c:\mytest.au3"

</code>

<{POST_SNAPBACK}>

#include is a compiler directive which causes the #include(d) files to be added to the Compiled Script at aut2exe time....

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

Understood. So is there any other way to accomplish this?

For instance, in Perl, I can eval code at runtime.

Thanks.

#include is a compiler directive which causes the #include(d) files to be added to the Compiled Script at aut2exe time....

<{POST_SNAPBACK}>

Basgetti.comSoftware worth donating to ...
Link to comment
Share on other sites

I do not quite understand how making it an exe will help. Can you give me an example of how this would help?

you could make it an exe.

if needed it gets downloaded and it can parse variables through the parameters.

<{POST_SNAPBACK}>

Basgetti.comSoftware worth donating to ...
Link to comment
Share on other sites

I think he means

InetGet() an exe on the server, then

Run() the exe

What you could do is if you need the script itself (not the compiled version), make two scripts. The first one will InetGet() the file you want, and then call the second one, which can have the #include<>, as the file is already residing locally.

Edited by MSLx Fanboy

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

This is what I ended up doing (two scripts - the first one downloads the script and saves it as a local file, then calls the other (non-compiled script) that has the downloaded file as an include.

This is a workaround but it sounds like AutoIT does NOT support run-time script evaluation like Perl and VBScript. This would be a very nice enhancement.

Even the workaround only works if the second script is not compiled. I was hoping I could compile an exe that would download code from a database and execute the scripted code as AutoIT script.

Steve

I think he means

InetGet() an exe on the server, then

Run() the exe

What you could do is if you need the script itself (not the compiled version), make two scripts.  The first one will InetGet() the file you want, and then call the second one, which can have the #include<>, as the file is already residing locally.

<{POST_SNAPBACK}>

Basgetti.comSoftware worth donating to ...
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...