HighTechTalks DotNet Forums  

Scopes (PushScriptObject / BlockScope)

Dotnet VSA microsoft.public.dotnet.vsa


Discuss Scopes (PushScriptObject / BlockScope) in the Dotnet VSA forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Kevin
 
Posts: n/a

Default Scopes (PushScriptObject / BlockScope) - 07-15-2004 , 05:33 PM






Hi,

I'm trying to add different scopes to a VsaEngine and change variables
values in these scopes at will...

I'm currently doing:
eng.SetOption("fast", false);
ScriptObject so = new BlockScope(eng.ScriptObjectStackTop(),"scope1",1);
eng.PushScriptObject(so);
Eval.JScriptEvaluate("var v = 1;",eng);
ScriptObject so2 = new BlockScope(eng.ScriptObjectStackTop(),"scope2",2);
eng.PushScriptObject(so2);
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 ?

Thanks!



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.