Errors for Spel methods

When you execute a Spel class method, an exception is thrown if there are any errors.
When an error occurs, the Spel class instance throws it to the calling routine. You should use error handlers in your application to catch this error. In some cases, you will only want to display an error message.

VB Example:

Sub btnStart_Click( _  
       ByVal sender As System.Object, _  
       ByVal e As System.EventArgs) _  
       Handles btnStart.Click  
  
  Try  
    m_spel.Start(0)  
  Catch ex As RCAPINet.SpelException  
    MsgBox(ex.Message)  
  End Try  
End Sub  

You can examine the error number associated with the exception by using the ErrorNumber property of SpelException.

  Try  
    m_spel.Start(0)  
  Catch ex As RCAPINet.SpelException  
    MsgBox("SPEL Error: " + ex.ErrorNumber.ToString())  
  End Try  

C# Examples:

  void btnStart_Click(object sender, EventArgs e)  
{  
  try{  
    m_spel.Start(0);  
  }  
  catch(SpelException ex){  
    MessageBox.Show(ex.Message);  
  }  
}  

You can examine the error number associated with the exception by using the ErrorNumber property of SpelException.

try {  
  m_spel.Start(0);  
}  
catch(SpelException ex) {  
  MessageBox.Show(("SPEL Error: " + ex.ErrorNumber.ToString());  
}