I was not talking of giving the object's name as argument to the script generator function.
What I meant was: forget about the script generator and just pass the simulationobject as parameter:
fixedsimulationfunc(mysimulation);
or better as it is more oop like:
mysimulation.run();
Here you use the this object to access mysimulation..
ScriptCode:
function run()
{
++this.time;
}
function()
{
// Initialize the run script.. maybe differently for different simulation objects?
simulation.run = run;
...
simulation.run();
}
function run()
{
++this.time;
}
function()
{
// Initialize the run script.. maybe differently for different simulation objects?
simulation.run = run;
...
simulation.run();
}
To copy to clipboard, switch view to plain text mode
Maybe I did still not catch why you want to do this.. Maybe you are forced to use the structure as it is.
Best of luck to you!
Johannes
Bookmarks