Jump to content

Run au3 files from a host process and pass data through


59FIFTY
 Share

Recommended Posts

I have a host process which should run .au3 files. The problem is that the .au3 files are made by the user and can contain certain errors which could corrupt the host process. So I decided to create a dedicated execute process which runs the .au3 files, that also works fine, but if i want to pass data between the host process and the .au3 file I'm running into problems.

I can pass data to the execute process, but not to the .au3 file. I tried to dynamicly include the .au3 file from the execute process by using Execute but that doesn't work. I know that I can pass data from the host to the execute and then to the .au3 file, but I don't want that, since the user should not include any functions or data to read from the STDIN in his own .au3 file.

Here's a little overview what the script should do:

1. host process generates $dataX = 1
2. host process runs execute process by using Run() and pass $dataX by using StdinWrite()
3. execute process parse $dataX by using ConsoleRead()
4. execute process generates Global variable $dataX
5. execute process dynamicly includes au3 file
6. au3 file has access to all functions and global variables of execute process
7. au3 file outputs $dataX by using ConsoleWrite()

Step 1 to 4 works fine, but I dont know how to make an enviroment for the .au3 file to provide access to all functions and variables of the execute process.

Link to comment
Share on other sites

I thought that... but how can I create a "virtual" environment for the au3 file to run in? The only idea that works is this:

create a temporary au3 file containing all the data to be set for the au3 file and include the au3 file at the end, then execute the temp au3 file from the host process by using run. The drawback is that I have to write a tempfile for every execution, which can cause a lot of performance problems, but is the only method that works I guess?

Edited by 59FIFTY
Link to comment
Share on other sites

It works no with that temproary method. Yout method is good as well, but one drawback is still there, in both methods, what can you do about errors? Can you precheck the script with the compiler if there is any error? Or how can i supress errors from the script so they don't show up in a message box?

Link to comment
Share on other sites

@59FIFTY

I am not sure what you are trying to accomplish.

But maybe my last experiment can give you some solution to do some dynamic stuff.

Creating COM objects without a need of DLL's

I hope it can help at least to get you going.

Regards

ptrex

Link to comment
Share on other sites

@ptrex

Your dynamic COM Objects are great, but doesn't solve my problen, in fact my problem has vanished into thin air I got it to work. I have a now a host process which runs an executable process which also includes a temporary created au3 file. This way you can mess up the au3 file without corrupting the host process.

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