JCL Help:JclEnumValueToIdent

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Converts an enumeration value to it's identifier.


Pascal

 function JclEnumValueToIdent(TypeInfo: PTypeInfo; const Value): string;


Parameters

Parameters Description
TypeInfo: PTypeInfo RTTI of the enumeration as returned by System.TypeInfo(enum type), JclGenerateEnum* or JclGenerateSubRange function.
const Value Enumeration value.


Return Value

The identifier name of the value if the value is in range. If it's out of range the resulting string will contain "Value out of range (ordinal=Ord(Value))."


Description

JclEnumValueToIdent converts an enumeration value to it's identifier. JclEnumValueToIdent does exactly the same as GetEnumName but doesn't require an ordinal value. In addition JclEnumValueToIdent will do a range check on the value and return a "Value out of range" string if it's out of range.


About

Unit

JclRTTI


Donator

Theo Bebekis


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page