{The S-lang C Library Reference}: SLang_restart

Next Previous Contents

## 62. SLang_restart

Synopsis

  Reset the interpreter after an error

Usage

  `void SLang_restart (int full)`

Description

  The `SLang_restart` function should be called by the application at top level if an error occurs. If the parameter `full` is non-zero, any objects on the S-lang run time stack will be removed from the stack; otherwise, the stack will be left intact. Any time the stack is believed to be trashed, this routine should be called with a non-zero argument (e.g., if `setjmp`/`longjmp` is called).

  Calling `SLang_restart` does not reset the global variable `SLang_Error` to zero. It is up to the application to reset that variable to zero after calling `SLang_restart`.

Example

  > `

  >           while (1)
  >             {
  >                if (SLang_Error)
  >                  {
  >                     SLang_restart (1);
  >                     SLang_Error = 0;
  >                  }
  >                (void) SLang_load_file (NULL);
  >             }

  > `

See Also

  `SLang_init_slang, SLang_load_file`

Next Previous Contents