Hello,
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
{
string Name;
int Value;
..
}
..
Variable v1 = new Variable("Length", 10); // Create a variable with
Name=Length and Value=10
vars.Add(v1);
Variable v2 = new Variable("Width", 10);
vars.Add(v1);
vars.Add(v2);
We set custom variables in scriptScope like this.
..
foreach (IVariable aVariable in vars)
{
scriptScope.SetVariable(aVariable.Name, aVariable);
}
..
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.
Sree
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com