Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!uwvax!dogie.macc.wisc.edu!csd4.milw.wisc.edu!indri!polyslo!csun!csuna!abcscagz From: abcscagz@csuna.csun.edu (Jeff Boeing) Newsgroups: comp.lang.modula2 Subject: type conversion question Message-ID: <2027@csuna.csun.edu> Date: 31 May 89 23:54:24 GMT Reply-To: abcscagz@csuna.csun.edu (Jeff Boeing) Organization: California State University, Northridge Lines: 17 I couldn't find this anywhere in Wirth's book (4th edition), so here goes: How do you convert from a cardinal or integer type to an enumerated type? I would like very much to keep a particular enumerated type in a program I'm writing, but this program requires that some data of that type be written to and read from a file. If x is of my enumerated type, it's easy enough to save it to a file by saying "WriteInt (ORD(x))" (after redirecting output, of course), but how do I read that value back in? Enquiring minds want to know! -- Jeff Boeing: ...!csun.edu!csuna!abcscagz (formerly tracer@stb.UUCP) ---------------------------------------------------------------------------- "Let's split up -- we can do more damage that way." -- Gh0stbusters