18.12.2012 Views

Embedding R Tutorial

Embedding R Tutorial

Embedding R Tutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Error Handling in C#<br />

� use try/catch/finally statements<br />

try<br />

{<br />

STATCONNECTORSRVLib.IStatConnector lConnector;<br />

lConnector = new<br />

STATCONNECTORSRVLib.StatConnector();<br />

lConnector.Init("R");<br />

lConnector.EvaluateNoReturn("plot(1:100)");<br />

lConnector.Close();<br />

}<br />

catch (COMException lExc)<br />

{<br />

System.Windows.Forms.MessageBox.Show("Error");<br />

}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!