Q.  What is the function to return the enum name?
A.  See http://www.techtricks.com/delphi/enumname.php


Regards

Sean Cross
IT Systems Development Manager

Catalyst Risk Management
PO Box 230
50 Dalton St
Napier 4140
DDI: 06-8340362
mobile: 021 270 3466
Visit us at http://www.catalystrisk.co.nz/

Offices in Auckland, Napier, Wellington & Christchurch

Disclaimer:
"The information contained in this document is confidential to the addressee(s) 
and may be legally privileged. Any view or opinions expressed are those of the 
author and may not be those of Catalyst Risk Management. No guarantee or 
representation is made that this communication is free of errors, viruses or 
interference. If you have received this e-mail message in error please delete 
it and notify me. Thank you."


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:delphi-
> [EMAIL PROTECTED] On Behalf Of Myles Penlington
> Sent: Thursday, 10 May 2007 11:18 a.m.
> To: NZ Borland Developers Group - Delphi List
> Subject: RE: [DUG] Why use a set when a string will work OK (and less
> code)?
>
> The advantage of enumerated types is strong compiler type checking. Ie
> no spelling/keying mistakes.
> If you use the normal convention for enumerated types, .e.g
>
> MyStayus = (msActive, msPending, msEnded ) etc
>
> Then you can use a function and RTTI to convert the enumerated type
> name
> into a string for display. There is a RTTI function that returns the
> name of an enumerated type e.g. "msActive", and then your function can
> strip off the leading lowercase characters.
>
> Myles.
>
>

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe

Reply via email to