using uCalcSoftware;

var uc = new uCalc();
// Trigger a syntax error
uc.EvalStr("1 +");

// Check the error state after the fact
if (uc.Error.Code != ErrorCode.None) {
   Console.WriteLine($"Error detected: {uc.Error.Message}");
} else {
   Console.WriteLine("Success!");
}

// Perform a successful operation, which clears the error state
uc.EvalStr("1 + 1");
if (uc.Error.Code == ErrorCode.None) {
   Console.WriteLine("Previous error was cleared by successful operation.");
}