Initializing help system before first use

Return Codes and Error Checking

Most of the functions in the C interface to the Optimizer use an integer return code to indicate if an error occurred.
The XPRS and XPRSprob member functions instead use the .NET exception mechanism to handle errors, throwing an exception of type XPRSException. This makes error handling easier, since a check is not required with every function call:
try {
  XPRS.Init(""); 
  Console.WriteLine(XPRS.GetBanner());
  XPRSprob prob = new XPRSprob();
  prob.ReadProb("myprob","");
  prob.MipOptimize("g");
  } catch (XPRSException e) {
  Console.WriteLine (e);
}
Because the return code is not used to indicate error status, several methods instead return data that in the C interface is returned via an output parameter. In general, a function that retrieves a single value returns it, whereas a function that retrieves more than one value is declared void and uses output parameters. For example:
/* In C */
char name[32];
int ret = XPRSgetprobname (name);
if (ret != 0) {
...
/* In C# */
try {
string name = prob.GetProbName ();
} catch (XPRSException e) {
...