Scopes (PushScriptObject / BlockScope) - 07-15-2004 , 05:33 PM
I'm trying to add different scopes to a VsaEngine and change variables
values in these scopes at will...
I'm currently doing:
ScriptObject so = new BlockScope(eng.ScriptObjectStackTop(),"scope1",1);
Eval.JScriptEvaluate("var v = 1;",eng);
ScriptObject so2 = new BlockScope(eng.ScriptObjectStackTop(),"scope2",2);
Eval.JScriptEvaluate("var v = 2;",eng);
It's working fine since "v" exists twice once in "scope1" and once in
"scope2" with two differents values.
Now from here, here is what I would like to do:
Eval.JScriptEvaluate("scope1.v = 3;",eng);
Basically how can I reference directly the variable "v" in the "scope1" ?
I thought that BlockScopes names would be available as global properties but
they are not ...
Am I erronously using BlockScope or PushScriptObject ?
Is there any other/better way to create scopes ?
|Thread Tools||Search this Thread|