Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!brutus.cs.uiuc.edu!uakari.primate.wisc.edu!unmvax!ogicse!verdix!bob From: bob@verdix.com (Bob Boulanger) Newsgroups: comp.lang.pascal Subject: Re: Another various question about TP 5.0 Message-ID: <201@verdix.verdix.com> Date: 5 Dec 89 16:57:45 GMT References: <303@usna.MIL> Sender: netnews@verdix.com Reply-To: bob@verdix.com (Bob Boulanger) Organization: Verdix Western Operations; Aloha, OR Lines: 28 In article <303@usna.MIL> baldwin@cad.usna.mil (J.D. Baldwin) writes: >Is there a good, clean way to convert the value of an enumerated ordinal >type to a string value? > You could use an array, like this: CONST Veggie = ARRAY[x..y] OF String[z] ('carrot', 'brocoli', etc); VAR Veg_Name : String[x]; BEGIN Veg_Name := Veggie[x]; Writeln (Veg_Name); END. Obviously, you could leave out the string variable assignment and just say Writeln (Veggie[x]); Hope this helps. Bob Bob Boulanger bob@verdix.com Verdix Corporation 1600 NW Compton Drive