<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 11/08/2022 18:11, Juha Manninen via
fpc-devel wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAPN1EhAPj7__rWhf6bJMNgp779mF_SS8ejsUv+zLfJr-y6=YOg@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote">The MaxValue is used in many places for
enum and set properties while GetEnumNameCount() is not used
anywhere.
<div>There are other similar bugs. At least these 2 in
propedits.pp look fishy:</div>
<div>- procedure TSetPropertyEditor.GetProperties<br>
</div>
</div>
</div>
</blockquote>
CompType of a set is an enum, so yes => GetEnumNameCount<br>
<br>
<blockquote type="cite"
cite="mid:CAPN1EhAPj7__rWhf6bJMNgp779mF_SS8ejsUv+zLfJr-y6=YOg@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote">
<div>- subfunction IsPropInSet under function IsInteresting</div>
</div>
</div>
</blockquote>
seems the same<br>
<br>
<blockquote type="cite"
cite="mid:CAPN1EhAPj7__rWhf6bJMNgp779mF_SS8ejsUv+zLfJr-y6=YOg@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote">
<div><br>
</div>
<div>OK, it was not a bug in FPC code. Sorry.</div>
<br>
</div>
</div>
</blockquote>
<br>
fpc code is still "unexpected".<br>
<br>
It takes into account the MinValue<br>
<br>
type TMyEnum = (a=5, b=7);<br>
<br>
GetEnumName(pt, 5) // a<br>
GetEnumName(pt, 6) // b // should be 7<br>
<br>
if it is just the nth name, then it should start at 0 (or if needs
be at 1).<br>
</body>
</html>