Jump to content
Sign in to follow this  
autoitty

Allowing multiple scrips access to the same variable, In real-time

Recommended Posts

autoitty

Just wondering if this is possible to implement or if it has already been implemented.

Share this post


Link to post
Share on other sites
autoitty

Is this possible?

Share this post


Link to post
Share on other sites
PsaltyDS

Is this possible?

Actually accessing the variable: No.

But there are many techniques for sharing data between scripts:

Writing to each other's controls

Shared disk file

Shared registry key

WM_COPYDATA messages (32bit number)

Network ports

Etc., etc., etc.


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
autoitty

So how would I go about doing this? I only have one number (ranging from 0-200) that I need multiple scripts to access. How would I store such a variable for accessing?

Share this post


Link to post
Share on other sites
Nahuel

You can just write it to a file.

The other scripts can check every now and then if such file exists. Once it does, read the values and do their thing.

Share this post


Link to post
Share on other sites
autoitty

I mean I need this number to be accessed/changed multiple multiple times in a matter of a second. Would it be fast enough to handle such a process? Perhaps I am not fully versed in the syntax. Can anyone provide a simple example of writing a number to a general text file or anything?

Share this post


Link to post
Share on other sites
autoitty

Using the file method isn't working the way I'd hoped -- is there just a variable i can hijack that any script can access? Some generalized variable?

Share this post


Link to post
Share on other sites
martin

Using the file method isn't working the way I'd hoped -- is there just a variable i can hijack that any script can access? Some generalized variable?

|Have at look at this example which shares data between up to 9 scripts. A later post in the same thread explains how it works.

Also, this thread has some examples.

Maybe what you need is a simple udf that does something like this

Setshare ($variable);set up a variable to be shared, done by script which has the data to be read by other scripts

Publish($variable) ; set the variable value to be read by other scripts

$shared = Getshare();set up reading the shared variable, done by a script which wants to read the value

$nowvalue = readshared($shared) update the value to the last published value


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
Jos

Just wondering if this is possible to implement or if it has already been implemented.

isn't that what you would use the Registry or INI file functions for ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     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

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  

×