Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!rayssd!rayssdb!rxb From: rxb@rayssdb.RAY.COM (Richard A. Brooks) Newsgroups: comp.lang.pascal Subject: Re: TP problem Message-ID: <1808@rayssdb.RAY.COM> Date: Fri, 13-Nov-87 12:11:07 EST Article-I.D.: rayssdb.1808 Posted: Fri Nov 13 12:11:07 1987 Date-Received: Sun, 15-Nov-87 09:59:00 EST References: <16249@topaz.rutgers.edu> <936@sask.UUCP> Sender: rxb@rayssdb.RAY.COM (Richard A. Brooks @ Raytheon Company, Portsmouth RI) Organization: Raytheon Company, Portsmouth RI Lines: 45 Keywords: ennumerated type error Summary: writeln(v) gives same error!!! In article <936@sask.UUCP>, lowey@sask.UUCP (Kevin Lowey) writes: > In article <16249@topaz.rutgers.edu>, jjoshua@topaz.rutgers.edu (Jonathan Joshua) writes: > > > > v is a variable with an ennumerated type, right? > > right > > > readln(v) ; > > gives an I/O not allowed error. I am using turbo pascal. > > Am I doing something wrong or do I need a REAL compiler? > > As far as I know, PASCAL only accepts input from the console into > STRING (array of char), integer, or real types. All other types (arrays, > records, enumerated types, and any other type you define) can only be written > to and read from files. But a writeln(v) will give you the same error!!!! Try this: program TEST; type ON_OFF = (ON,OFF); var v = ON_OFF; begin readln(v); writeln('Switch is now ',v); end. Upon compiling the above, you will recieve an I/O not allowed error at the "readln(v)" and the "writeln(v)", if the readln is removed. TP does NOT allow you to read or write ennumerated types to the screen!!! Is this so in 4.0?? I know you can change types, but what a pain. -- Richard Brooks {allegra, gatech, ihnp4, linus, raybed2}!rayssd!rayssdb!rxb Raytheon Service Company // When everyone is out to get you // Portsmouth, Rhode Island // Paranoia is just good thinking ! //