Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Delphi-News aus aller Welt (https://www.delphipraxis.net/58-delphi-news-aus-aller-welt/)
-   -   SafeGetEnumName a safer implementation of TypInfo.GetEnumName (https://www.delphipraxis.net/215370-safegetenumname-safer-implementation-typinfo-getenumname.html)

DP News-Robot 21. Jun 2024 10:50

SafeGetEnumName a safer implementation of TypInfo.GetEnumName
 
I just had the need for a safer version of Delphi’s GetEnumName, which checks whether the enum value passed to it is actually valid. This is what I came up with: The difference to the original is the IF statement in line 25 that checks whether Value is < T.MinValue or > T.MaxValue. If the … <a href="https://blog.dummzeuch.de/2024/06/21/safegetenumname-a-safer-implementation-of-typinfo-getenumname/" class="more-link">Continue reading <span class="screen-reader-text">SafeGetEnumName a safer implem

Weiterlesen...


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:55 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz