Jump to content

keep '#include' au3 file editable after compiling main exe


pedrit0
 Share

Recommended Posts

Hi all.

I have created an external au3 (a library of functions and vars) that is #included in a main script that i must compile.

I wish that the content of the library is not merged with the main script when compiling.

My goal is to keep the ability to modify the library even after the main exe is compiled and that these changes are effective when executing the exe.

I guess this is not possible using the standard #include method.

Is there a way to do that ?

thx a lot :-)

Edited by pedrit0

Pedrit0, calme et tranquille, la tete dans les nuages et la b*** dans le champagne.

Link to comment
Share on other sites

I am having trouble understanding why you would need to do that?  If you want to read dynamic data into your application you can use a file.  You can also shellexecute au3 source files against the autoit exe.  Perhaps you can explain what you are trying to specifically accomplish for a more precise answer?

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

Hi Jfish

I have 2 files:

- mainscript.au3

- FunctionLibrary.au3 that contains the functions to be used by mainscript

I want to compile mainscript.au3 but not FunctionLibrary.au3 because i want to be able to modify it later without having to recompile the mainscript.

I know this behavior is not possible with the #include method that would merge the library to the mainscript during compilation. Which means that the external library would become useless.

So I am looking for another method.

Pedrit0, calme et tranquille, la tete dans les nuages et la b*** dans le champagne.

Link to comment
Share on other sites

29 minutes ago, pedrit0 said:

because i want to be able to modify it later without having to recompile the mainscript

My only goal. For an IT project. The exe would run 'in production' on a server and its function library can be edited/updated without having to modify the main exe.

Can you develop about ' shellexecute au3 source files' ? Sounds interesting but when I google it it seems not to fit exactly to what I need.

Edited by pedrit0

Pedrit0, calme et tranquille, la tete dans les nuages et la b*** dans le champagne.

Link to comment
Share on other sites

External functions that do not stick to the script own structure. These functions can be altered/modified without threatening the main script process.

The vars are global vars that could be used by several scripts later.

Pedrit0, calme et tranquille, la tete dans les nuages et la b*** dans le champagne.

Link to comment
Share on other sites

What I mean is that I cannot pass trough using ini or xml files as a workaround. The goal is really to store some functions in the library.

Pedrit0, calme et tranquille, la tete dans les nuages et la b*** dans le champagne.

Link to comment
Share on other sites

How would the main script know about the new functions so as to execute them ... ini files would work for the vars, but you are saying you can't use those.  Why?  What is the difference between that and using an au3 file that contains the same info?

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

Oh I get your misunderstanding... sorry. I have made up this system:

- I have an ini file listing some steps of processings. Step# = FunctionName()

- I have the main script parsing the ini file and executing the iniread as a function call in a loop, whatever the function is and whatever its name. So no need to know the function for the main script.

- the function to be executed is stored in the functionlibrary.au3

- several persons need to update / add functions in the library without recompiling anything.

Pedrit0, calme et tranquille, la tete dans les nuages et la b*** dans le champagne.

Link to comment
Share on other sites

sounds like executing raw au3 files against the au3 exe from your main script as fed by the ini would work ... 

I created a program called "scriptrunner" that did basically that.  You could record scripts, edit them, and sequence them to be run from the main application.  There may be other ways that are better but I will defer to others for those ... 

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

I have just tried but the global vars declared in the library are not detected by the main script... but i think this a good clue and I try out all I can with that tomorrow. Tired. Going to bed. thx a lot for the time you have spent on the topic :-)

Edited by pedrit0

Pedrit0, calme et tranquille, la tete dans les nuages et la b*** dans le champagne.

Link to comment
Share on other sites

to be noted : when using that you must disable Au3Check before compilation... it won't like unexplicitely declared vars.

Edited by pedrit0

Pedrit0, calme et tranquille, la tete dans les nuages et la b*** dans le champagne.

Link to comment
Share on other sites

  • 6 years later...
  • Developers

What is the reason you need to change the script code and that can't be done with an ini file?

Ps that member hasn't been around the last 6 years!

Edited by Jos

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

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

×
×
  • Create New...