Sign in to follow this  
Followers 0
slloyd

Runtime Includes

7 posts in this topic

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>


Basgetti.comSoftware worth donating to ...

Share this post


Link to post
Share on other sites



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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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())

Share this post


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

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