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. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nick Sent: Thursday, 10 May 2007 10:49 To: NZ Borland Developers Group - Delphi List Subject: [DUG] Why use a set when a string will work OK (and less code)? Why use a set when string work ok? (and I think it's a set) Question: I have seen this quite a bit and apparently it's "good practice" however to me it seems like more work. Example Whats the point in doing this MyStatus = (Active, Pending, Ended, Paused, Deleted, Suspended);); type Something = class name : string; status : MyStatus; end; then example on create or something status := Active; (yes, missed out lots of steps :P) and now if I want to show the status, I have to do something like.. If status = MyStatus(Active) then showmessage('Active'); If status = MyStatus(Pending) then showmessage('Pending'); etc Why go though all that hassle when just doing this is fine status : string; status := 'Active' showmessage(status); so instead of using "MyStatus" types I just use a string - this means when I want to output the status to the user I don't have to try and convert it to string first. So, why do it? Hmmmm Nick _______________________________________________ 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 Attention: This communication is confidential and may be legally privileged. If you are not the intended recipient, please do not use, disclose, copy or distribute it, other than to return it to us with your confirmation that it has been deleted from your system. _______________________________________________ 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