﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1334	dynamic include - rt embedding - Bug found?	benjamin-thomas.schreiber@…		"How about the try to do dynamic includes like:
#include $myFile[0]
Sure I know include is a compile-time problem.
This leads to the idea to embed/inject sub-code within a running script that runs in the current script's context/state.
I have a problem like this, where a user wants to tell me to use a customized code part to a running script. A kind of ""controll script"" - that is known during runtime. ( I want to do some script generator with a running script that can be stopped, changed and continue with the user change ) - it's something like a gui-test-sequence-designer...
If i have to include this controllscript in a function stub, then i have to start an execute-script but will loose the framework's context. All globals are gone, all states are gone, etc...

I think of some rt-env, like in ruby, where an interpreter can build up classes and messages during runtime.
Or think of php, there it's also possible over an eval a complete php scripting during rt. The AutoIt's eval is for vars and the execute is only for expressions - no chance to evaluate complete scripting parts within the running context.

First I thought I do something like:
---snip--
func myUsersRtFunc
  ; do something the user got...
  ; this also could be no function but a static code block
endfunc
---
After that a ""dynamic include"" would be fine, but - duh, sure it's a compile time directive...
Then I thought something like execute(""userScript.au3"") would work, but it's only for single expressions...

Current solution is to save my framework context and load it again, then re-generate the running script with loading back the context variables. 

Alternatively it would be possible to save the context and let an interpreter run a second task with ""Run"", load the context into that executed script and let it work. The result of this script has to be interpreted within a ""protocol"" over the StdOutRead of the caller.

The user's sub-code may change framework globals, and have to save this context back, so the caller(the frame) can load it after call again... what a struggling =)

You see it's really tricky to do such stuff without basic autoIt support to that.

You know the AutoItDebugger ? It handles it by generating ""controlpoint-wrap-calls"" and ""WM_COMMAND"" as feedback. Ever thought to support debugging with a ""trap"" mode within the interpreter ? ( that would be a feature for a interpreter with runtime environment )




I want not open another ticket, but I dont know if this is a (small)bug - or a known or rejected issue (found no ticket related to it):

I started a timer that handles user requests (tcp) and handles the tray menu execution, blocked the script with a main-loop.
Now if I implement e.g. a tcp function that will use a call(""funcx""), with funcx containing a sleep, then the timer stops to tick while the called function sleeps.
If I do it by a direct function call to funcx(), the timer continues ticking while the funcx sleeps. (thats what i wanted)
The problem is due my inlcude hierarchy the tcp-commands are implemented in ""base includes"", but the function that is to be executed is ""above"" the code where no include is possible because I would get a circular dependancy.
Maybe I did something wrong, but can you investigate this ? Or is it know that a call to a sleeping function stops timers ?

( My solution is to ""listen"" to a global variable and then let the script part with the main-loop and the funcx implementation execute funcx as soon as the variable is set to true. So there are workarounds )
"	Feature Request	closed		AutoIt		None	Rejected	dynamic include runtime embedding	
