[Gambas-user] Script object inherits process,

Brian G brian at westwoodsvcs.com
Tue Jun 29 21:36:00 CEST 2021


Hi Benoît, 

It actually seems to makes sense for script to inherit process, but the hitch I have run into is that there seems to be no way 
to have one process to copy the configuration of another to it's self. 

if I have a class script that inherits process and the creation looks like: 
MyScript = new script("~/Scriptfile) as "TheScript" ' this sets up the script and does the compile etc. 
or 
Dim MrScriptText as string = "For i as integer = 0 to 10\nPrint \"Hi\"\nnext 
MyScript = new script("CacheName",MyScriptText) as "TheScript" 

now call something like 

MyScript.run(ScriptParm1, .... etc) ' this actually does the exec and gets the real process object 

is there some way to make Me as in the script object copy all the io, pid etc information to its self 
from the process object returned from exec in effect becoming equal in stream, pid etc to the process returned from exec? 

This would be great allowing the removal of the ExecCallBack 
TheScript_read(), TheScript_kill(), TheScript_error(), and any extended special events for scripts can now be defined directly. 

and 

Print #MyScript, "Hello Word" 


The idea for the badly named called backs for handling pre-process and post process process was to allow an array of plugin scripts as objects each one called to do something to the source code. 

the ScriptApply Plugin scripts were not in document but available to be called directly for a source buffer. 
the ScriptSet Plugin scripts, actually tells the reader/tokenizer what plugins to apply to the processed code. 
This was not really intended to be a user accessible event. Only a way for users to provide plugins to the scripter. 

Changing the names form ScriptSet...Calback(callbackList) to ScriptSet...Plugins(PluginList as objects[],...) so now we have 

ScriptSetPreProcessPlugins(PreProgramPlugins as object[], PreLineProcessPlugins as object[]) 
ScriptSetPostProcessPlugins(PostProgPlugins as object[]) 
ScriptSetPreProcessPlugins.clear() 
ScriptSetPostProcessPlugins.clear() 


"Failure is the key to success; 
each mistake teaches us something" .. Morihei Ueshiba 
Brian G 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210629/b81496df/attachment.htm>


More information about the User mailing list