Jump to content

Renew #Include


 Share

Recommended Posts

Perhaps if you posted what your script(s) look like, a description of how you'd want to change them as they're running, what the data looks like that it's working with, and anything else you'd think would be pertinent it would make it easier to see how to go about it without rewriting a script on the fly.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

How about an SQLite database?  Open it in script one as default access (e.g. read write and create), open it in the other as read only.  Have a table where the column looks like your array, and also put in a row index, or a timestamp, or something so the reader side can "remember" what all it's seen.

Writer writes whatever data it has whenever it has it, reader does the equivalent of a select * from foo where rowindex > $last_read .

[EDIT] If the write really hammers the hard drive, then wrap it in a transaction that commits after each (say) 1000 writes.  That'll keep the write in memory until a bit of data is built up - which in turn will boost performance.  Make the number of writes a constant, and then play around with values until you find a value that works for you.

Edited by mrider

How's my riding? Dial 1-800-Wait-There

Trying to use a computer with McAfee installed is like trying to read a book at a rock concert.

Link to comment
Share on other sites

mrider,

Was just thinking the same, but we need more info like frequency, volume and use.

@millisys - For the best help post your script as BrewmanNH has suggested.

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

millisys,

From reading your post for the third time here is what I understand:

A script runs all day ( call it script #1 )

A second script runs at night, or periodically during the day, to process data collected from script #1.

If this is not correct it might make sense to describe what you are trying to do.  There are many example of writer / reader type apps, mostly for log files.

It might benefit you to describe exactly what you are doing.  There are some very experience programmers here to help.

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

Maybe I'm missing the point, but wouldn't it be easiest to just have the second script spit its output, and then have the first script read it from the StdOut (and/or StdErr) read from the child process? See the example script in the help files for StdErrRead() function.

Apart from that, generating actual autoit code to be executed is almost never a good idea. Fun to think about, maybe fun to have some sort of evolving code experiment (script one writes and runs script two, which then writes and run script one, which then writes and runs script2......), fun for maniacal scientists who want to take over the world Skynet-styley, but for daily purposes, nah... Not clean. Using an in-between solution like a database or a temp file seems much nicer.

If you are worried about hammering the hard drive but still would like to work with temp files, how about creating a ram drive? (You'd need quite some ram if the data gets really big, but it's very possible.)

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

I feel more comfortable with data staying in ram rather than being written to hard disk. It's ok with settings info, but constant hammering of the hard drive to transfer array data makes me concerned about data integrity

Constantly rewriting scripts, as you were originally proposing, would have been hammering your hard drive anyway.  I suggest going with an SQLite database, as was suggested earlier.

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