uCalc API Version: 2.1.3-preview.2 Released: 6/17/2026
Warning
uCalc API Preview Release Notice:The documentation describes the intended behavior of the API. The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.
GetMessage
Method
Product:
Fast Math Parser
Class:
ErrorInfo
Retrieves the descriptive message for a specific error code.
Syntax
GetMessage(ErrorCode)
Parameters
errCode
ErrorCode
Enum member to retrieve a specific error message.
Return
string
The error message as a string. Returns "No error" if no error has occurred or if the specified errorId is ErrorCode::None.
Remarks
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.
Examples
GetMessage
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