Retrieves the descriptive message for a specific error code.
Product:
Class:
Warning
uCalc API Preview Release Notice:The uCalc engine has successfully transitioned to modern cross-platform environments.The next phase envolves some structural changes, performance optimizations, and API refinements.The API is subject to breaking changes prior to the stable release. Please evaluate the preview version thoroughly before production use.
The error message as a string. Returns "No error" if no error has occurred or if the specified errorId is ErrorCode::None.
When called with an enum member, like uc.ErrorMessage(ErrorCode.Syntax_Error), it returns the generic, built-in message for that specific error code, regardless of what the last error was. This is useful for building custom error displays or documentation.
ID: 802
using uCalcSoftware;
var uc = new uCalc();
Console.WriteLine(uc.Error.GetMessage(ErrorCode.Syntax_Error));
Console.WriteLine(uc.Error.GetMessage(ErrorCode.FloatOverflow));
Syntax error
Floating point overflow using uCalcSoftware; var uc = new uCalc(); Console.WriteLine(uc.Error.GetMessage(ErrorCode.Syntax_Error)); Console.WriteLine(uc.Error.GetMessage(ErrorCode.FloatOverflow));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
cout << uc.Error().GetMessage(ErrorCode::Syntax_Error) << endl;
cout << uc.Error().GetMessage(ErrorCode::FloatOverflow) << endl;
}
Syntax error
Floating point overflow #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; cout << uc.Error().GetMessage(ErrorCode::Syntax_Error) << endl; cout << uc.Error().GetMessage(ErrorCode::FloatOverflow) << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Console.WriteLine(uc.Error.GetMessage(ErrorCode.Syntax_Error))
Console.WriteLine(uc.Error.GetMessage(ErrorCode.FloatOverflow))
End Sub
End Module
Syntax error
Floating point overflow Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Console.WriteLine(uc.Error.GetMessage(ErrorCode.Syntax_Error)) Console.WriteLine(uc.Error.GetMessage(ErrorCode.FloatOverflow)) End Sub End Module
This page last modified on: