//--------------------------------------------------------------------------//
// Initialize Handler to switch of tonic current ar a given Timepoint START //
//--------------------------------------------------------------------------//

// Handling of the output data ([Cl-]i and i(SEclamp)) via the print window

objref fih
fih = new FInitializeHandler("init_tonic()")

proc init_tonic() {
  printf("Init-ok, Start = %g",START)
  leak_tonic = 0.00000875     
  cvode.event(START, "set_tonic()")
}

proc set_tonic() {
  printf("Call executed")
  leak_tonic = 0.00000875 + 0.000025
  if (cvode.active()) {
    cvode.re_init()
  } else {
    fcurrent()
  }
}

START =  5000000 // ms

// Run Simulation --------------------------------------------------------
     init_tonic()
     run()