Quote Originally Posted by jdarling
Oh yeah, final note, PIL and PIL 2 are your friends. Read them, and buy a copy if you can afford it.
Gracious, you weren't kidding! LUA is far more efficient and powerful than I had originally thought. Hmm. I am nowhere near done reading though. I may end up buying PIL 1 & 2 for references, and so that I can also employ Lua in any of my future projects. It is certainly far more powerful than I imagined!

I think my program, instead of being a service, will just be a tray application with a configuration that writes to an XML file. This way I can change the icon when something is running, or even change it to a textual "gauge" to show progress of a weightier script. I think it would be best that way, because I can also bind it to let the user execute any script in their library directory at any time by a direct right-click menu. I think that would work just fine. Not to mention, I have absolutely no clue how to install a service application.

As to some more advanced date/time manipulation, I am still thinking. I don't want the memory overhead of keeping a "minute counter" per item, so the best way would be a "last run" date. Then I could just do a fast boolean check of when the "lastrun+interval <= now" evaluates true; I think I can use a sort of addition expression to the dates in Delphi, but I must do some research on that.

When a task is called, multiple ones may be called at once, I will add the script name and operating object to a stringlist but I won't support threaded function calls. At least initially. I am uncertain at this point, still haven't read far enough, about how I would go about marking a script as free. As for task configuration the simplest way will be a key=value list, an editor/component for which already exists. This way I just create (using a certain ECXML object ) an entry into the configuration like this:
Code:
<luaExec>
  <!-- Generic Options -->
  <options></options>
  <tasks>
    <task option="value" ... />
  </tasks>
</luaExec>
So then when loading the configuration file I just pull specific options like "script" and "interval" out and dump the rest to a Lua table that could be considered a "global object" independently put into each script. For that, perhaps a record of the lua-object, script name, and configuration record would be more expedient.

To handle the task icon I have a few components already, so I'm not concerned. However I will code some Lua functions to update the hint, progress "label" in the icon, and (in general) permit switching between the two standard icon, and dynamically modified one.

I will of course extend Lua with recursive searching of the file system, returning a table/array of strings, and a few other simpler matters. However one thing a person will always want, is the ability to track execution and errors in your tasks ... so I think I might employ a simple RSS feed which you can "subscribe" to on your own computer, and which is updated upon each (un)successful operation. This would involve a global script, as in this way the data gathering is much more dynamic and used in a very rapid form. This way I can also permit greater flexibility in logging through this functionality, while using built in I/O functions to write the data to the file.

Quote Originally Posted by jdarling
Something to keep in mind is that Lua maintains state information until you call close. So if you run "a = 5" and then run "print(a)" you will get an output of 5, unless you called close between the two calls. Use this to your advantage.
I am not entirely certain what you mean by this. From what I understand if you execute the script and the execution runs through, it consists of one "pass". Therefore of course the variable persists, but do you mean that between concurrent executions without freeing the script the variables are held? Or would this change at all in a threaded execution of a given function? Like I said, I'm scarcely into part 1, section 7.1, so I haven't read a whole heck of a lot about Lua yet.

I have never exactly understood mailing lists, or used them, so I am not sure how I would join or post messages to it. Is it like a newsgroup? I don't know how to do more than read those, and sending messages are restricted to special servers an ISP or generic web server may have.

Thanks for the updated version of the Lua objects; I will try and create a test bed soon, but aside from reading and planning the actual operation of this application ... I think my hands will be too full for that yet! :lol:

Thanks for taking the time to answer all of my questions.