[IronPython] Accessing scope variables
sree_b_pillai at yahoo.com
Thu Aug 6 11:57:28 PDT 2009
We are hosting IronPython in our Windows forms-based application to allow our customers to write scripts. We allow customers to use our own variables within the script.
public class Variable
Variable v1 = new Variable("Length", 10); // Create a variable with Name=Length and Value=10
Variable v2 = new Variable("Width", 10);
We set custom variables in scriptScope like this.
foreach (IVariable aVariable in vars)
With this, user can write a function like this
def CalcArea() :
return Length * Width
In our application, we are dealing with hundreds of variables and functions. As the user deletes or modifies a Variable (here Length and Width), they would like to know where the variables are used. In this example, the variable Length and Width are used in CalcArea function. I can't find a way to identify the list of custom variables used within a function using the API.
Any suggestions? Thanks a lot.
More information about the Users