Rapid method to share between scripts

Propose new features and changes
Rayth
Posts: 11
Joined: 11 Mar 2017, 10:56

Rapid method to share between scripts

11 Mar 2017, 15:06

Hello,

To share the contents of a variable from another script, I found a long time ago on this forum this methode :

objShell := ComObjCreate("WScript.Shell")
objEnv := objShell.Environment("Volatile")

Then using this format to read or write :
objEnv.Item("Test") := 1

It works well for reading, but this is really slow for writing, it takes several seconds to change just a few variables.

I think an option to use the same variables between scripts would be handy.

Exemple :
A #Thread function with an identification parameter:

#Thread, "what_i_want_here"

Where "what_i_want_here" can be a number or a name. All scripts with same number or name would use the same variables and could read / write them freely and thus interact with each others.

This method would be very simple and would allow to easily create scripts in multithreads without modifying heavily their codes.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Rapid method to share between scripts

11 Mar 2017, 16:18

There are already numerous ways of achieving variable sharing between scripts, many of which have already been suggested to you in your other thread.

Your proposed feature would require synchronising variable access between the two processes, which would seriously affect the performance of one of the scripts and possibly defeat the purpose of having two processes in the first place.
Rayth
Posts: 11
Joined: 11 Mar 2017, 10:56

Re: Rapid method to share between scripts

11 Mar 2017, 16:58

I understand, i try to use your ObjRegisterActive function but ...
I am not a professional programmer, I use primarily autohotkey for its simplicity, but there seriously it's not noob friendly :p

I add the function in my lib, the two tests scripts work and i got that hello world, okay.
But as simply as possible, what should I put in each script to have a variable defined in first script and read in the second ?

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 21 guests