[fpc-pascal] How can you convert an enum value to string?

Howard Page-Clark hdpc at talktalk.net
Sat Dec 13 11:22:04 CET 2014


On 13/12/2014 02:50, silvioprog wrote:
...
> for i := 1 to c do
>      getenumname(typeinfo(tenum), integer(en));
...

I think for a fairer comparison with WriteStr the compared GetEnumName 
call should be

...
for i := 1 to c do
   s := GetEnumName(TypeInfo(tenum), integer(en));
...

Mind you, on my system, such an adapted GetEnumName assignment remains 
faster than WriteStr.

Howard

---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com




More information about the fpc-pascal mailing list