I'm wanting to do this for debugging purposes, i.e. something like:
Code: Select all
IF (fooBar > maxLegalValue) {
printf ("Variable fooBar has been assigned an illegal value: %g\n",fooBar)
dummyVar = 1/0
}Code: Select all
IF (fooBar > maxLegalValue) {
printf ("Variable fooBar has been assigned an illegal value: %g\n",fooBar)
dummyVar = 1/0
}Perfect. Thanks. Turns out if I'd just guessed, & tried "abort()" I could have avoided bothering you with a question. However, I'm glad I did bother you, because now I know the "stoprun = 1" trick, which is the answer to the question I *should* have askedhines wrote:is a good way to stop immediately. And is what I use when I am using gdb and wantCode: Select all
abort()
to get control at a specific location (usually before an assert error).
If you want to return immediately to the interpreter useif you want to stop at the end of the current step use the global varialbeCode: Select all
hoc_execerror("message1", "message2")and then set it withCode: Select all
VERBATIM extern int stoprun ENDVERBATIMCode: Select all
stoprun = 1