GetMessage

Method

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.

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

ID: 802

See: 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
				
					#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;
}
				
			
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
				
			
Syntax error
Floating point overflow