Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!ubc-vision!alberta!sask!lowey From: lowey@sask.UUCP (Kevin Lowey) Newsgroups: comp.lang.pascal Subject: Re: TP problem Message-ID: <936@sask.UUCP> Date: Sun, 8-Nov-87 23:23:10 EST Article-I.D.: sask.936 Posted: Sun Nov 8 23:23:10 1987 Date-Received: Thu, 12-Nov-87 06:48:16 EST References: <16249@topaz.rutgers.edu> Organization: University of Saskatchewan Lines: 31 Keywords: ennumerated type error Summary: The Answer (I think) 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. To do what you want, you will have to input a character from the keyboard, then use a case statement to assign the correct variable to the enumerated type depending upon the value of the character. Internally, the enumerated type is stored as an integer (or some variant like BYTE), so you may be able to enter a number from the keyboard, but I doubt it. ______________________________________________________________________________ | Kevin Lowey |The above is the personal opinion of Kevin | | University of Saskatchewan |Lowey. It does not reflect the position of| | Computing Services |the University of Saskatchewan in any way. | | SaskTel: (306) 966-4826 | | | Bitnet:LOWEY@SASK. (preferred) |I am in no way affiliated with any of the | | UUCP: ihnp4!sask!lowey.uucp |above mentioned companies other than U of S| |________________________________|___________________________________________|