WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-05-2006, 08:38 PM
nickyee nickyee is offline
Member
 
Join Date: Jun 2004
Location: Stanford, CA
Posts: 19
Viz 3B - Scope of Interactive Window and Script

In the past, the scope of the interactive window at the bottom and the script itself (once run) seemed to be the same. So if I had "x = 3" in the script, I could access it in the interactive window by typing in "x". This no longer seems to be the case in 3B (or maybe it was changed earlier ... ?) and the two seem to be in different scopes altogether. Is there a way to get them to be in the same scope (or is there a way for me to get to the scope of the script in the interactive window)?
Reply With Quote
  #2  
Old 09-06-2006, 09:30 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

The interactive window and the script have always been in separate
interpreters (or scopes). However, there is a significant difference
between 2.x and 3.0. In 2.x, when you ran a script, it would first be
executed in the same interpreter as the interactive window. This first
execution would initialize all your global variables. Then the script
would be launched in a separate process with its own interpreter. This
first pass would pollute the interactive interpreter with all the
global variables of the script.

Vizard 3.0 bypasses this first execution and immediately launches the
script in a separate process. You can still type commands in the
interactive window, but only while your script is running. The
interactive window is actually more powerful in 3.0, because you can
modify global and runtime variables in your running script, which you
previously couldn't do in 2.x

Are you trying to access the variable "x" after the script has
finished? If so, this won't work in 3.0. Even though it did work in
2.x, the functionality wasn't very useful, because the value would not
reflect any changes that were made at runtime.

Hope this helps. Also, in the future please post Vizard 3.0 related
questions in the 3.0 forum.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

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

Forum Jump


All times are GMT -7. The time now is 10:20 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC