Page 1 of 1

Running the simulation several times automatically

Posted: Sun Jul 05, 2009 10:54 pm
by Bill Connelly
I was hoping to be able to get the simulation to run several times but doing thing

Code: Select all

runtimes=20
xpanel("Run Control")
xvalue("Simulation Repititions", "runtimes")
xbutton("Run", "gorun()")
xpanel()

proc gorun() {
  for n=0, runtimes-1 {
    run()
  }
}

proc run() {
  preprocess()
  print "RUNNING SIMULATION..."
  stdinit()
  continuerun(tstop)
  postprocess()
}
but it just runs once. What can I do about this?

Re: Running the simulation several times automatically

Posted: Mon Jul 06, 2009 12:32 pm
by ted
Offhand, I'd guess that some other code is stepping on n, in which case
proc gorun() { local n
should fix the problem.

Re: Running the simulation several times automatically

Posted: Mon Jul 06, 2009 3:52 pm
by Bill Connelly
...sigh...
Thanks Ted.