QuimV wrote:Yes, I'm talking about using minScript to effectively create boolean links between not Purebasic variables, I mean, the user creates the variables and the relationships between them and stores them in a line of a text file. Every second, the PureBasic program loads the text file and evaluates the result of each relationship, line by line, and saves the result and a timestamp in a database.
The other alternative I have is to use VBscript with COMatePLUS.
Yes that should be possible although loading the text file every second sounds a bit much!
If you can 'word' the relationships in terms of minScript code then you shouldn't have a problem doing that sort of thing. If you can do it with VBScript then you can do it with minScript.
minScript's standard runtime does not at this time include file or database functions, but then it can't include everything. You would need to add the appropriate runtime functions yourself which is pretty straightforward; an integral part of any scripting engine.
Having said that, adding runtime functions is easy in principal if the said functions do not create a potential for memory leaks. Having a OpenFile() type function, for example, is definitely one with this potential because if the script-writer then forgets to invoke a corresponding CloseFile() type function (or the script generates an error before the CloseFile() is called), then the file will remain open! minScript's garbage collector can do nothing about that.
An OpenFile() type run-time function is thus 'fiddly' because whoever creates this function needs to also create an 'extension' to our garbage collector to deal with any 'wayward' file handles and the like. We had to do something similar for our AllocateMemory() runtime function.
Probably best if I simply add some file functions to the standard runtime myself when I get the chance as I can easily create the necessary garbage collector extension (or just extend the existing AllocateMemory() one). Mind you, this problem would be removed if you created a run-time function which opens the file, reads the data and then closes the file before passing control back to the script. No possibilities of any file handles remaining open with this. The data read can then be shoved into a global script array or some such so that the script can work on the data.
A similar thing holds for any runtime function which opens a database etc. (unless the function closes the database before finishing!)
Yes, when I get a chance I will either add some file runtime functions or a file object as it is probably a feature which a lot of scripts will require.
I may look like a mule, but I'm not a complete ass.