Path: utzoo!mnetor!uunet!mcvax!ukc!dcl-cs!gareth From: gareth@comp.lancs.ac.uk (Gareth Husk) Newsgroups: comp.lang.pascal Subject: Re: Pascal Enumerated I/O Message-ID: <481@dcl-csvax.comp.lancs.ac.uk> Date: 23 Feb 88 10:23:12 GMT References: <11903@brl-adm.ARPA> Reply-To: gareth@comp.lancs.ac.uk (Gareth Husk) Organization: Department of Computing at Lancaster University, UK. Lines: 42 >> I'm trying to find out if any version of Pascal running on any machine >> supports I/O on enumerated data types. Example: >> ... >> I think I've heard of versions of Pascal that allow I/O on enumerated >> types, but I can't for the life of me remember any specifics. >At best, not a portable solution... >> Danny Sharpe, Ga Tech Box 34832, Atlanta, GA, 30332 Certainly the Berkeley pc compiler allows the output of enumerated values as strings directly. However I have not been able to convince it to accept enumerated values without a conversion routine ie read string compare and assign an enumerated value. However the pc compiler allows all sorts of strange little things to happen, it doesn't do proper bounds checking and only produes an error if you try to assign a value to memory space assigned to a different base type. Thus arr1 : array[1..10]; ch : char int1 : integer ; ... i := 11 ; arr1[i] := 'x' ; { this works } i := 12 arr[i] := 'y' ; { this fails } Can you imagine the errors this produces when you are reading lots of text and one read goes wrong. -- " I am a doughnut " JFK UUCP: ...!seismo!mcvax!ukc!dcl-cs!gareth DARPA: gareth%lancs.comp@ucl-cs JANET: gareth@uk.ac.lancs.comp