Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ncar!gatech!mcnc!uvaarpa!vger.nsu.edu!g_harrison From: g_harrison@vger.nsu.edu Newsgroups: comp.lang.pascal Subject: Re: Request: Help with Enumeration Type Message-ID: <379.276874b5@vger.nsu.edu> Date: 14 Dec 90 10:44:05 GMT References: <6213@tertius.in-berlin.de> Lines: 47 In article <6213@tertius.in-berlin.de>, gaertner@tertius.in-berlin.de writes: > To write values of an enumeration-type onto an external file you have to > use the PUT routine. The following short program shows the way on a VAX. > > > > > PROGRAM Test ( OUTPUT, DataFile ) ; [etc.] No, the use of PUT is not necessary in VAX Pascal. Try program ETEST (FUZZY_FILE, OUTPUT); type FUZZY = (YES, NO, PERHAPS); var FUZZY_FILE : FILE of FUZZY; F : FUZZY; begin REWRITE(FUZZY_FILE); {External will be FUZZY_FILE.DAT} for F := PERHAPS downto YES do WRITE(FUZZY_FILE, F); RESET(FUZZY_FILE); while not EOF(FUZZY_FILE) do begin READ(FUZZY_FILE, F); WRITELN(F) end end. Output is PERHAPS NO YES This is NOT a flame. I too prefer to use the PUT routine on sequential files. George.... ------------------------------------------------------*------o Happy--- -- George C. Harrison ------------------------------ * * ----o_o___ New--- ----- Professor of Computer Science -------------- * * * ----\ o /-Year-- ----- Norfolk State University, ----------------- *Merry* ----\ /-------- -------- Norfolk, Virginia 23504 --------------- * * * * * ----|--------- ----- INTERNET: g_harrison@vger.nsu.edu ------ *Christmas* --_|_-------- ----------These are MY views.... you may share them..*** -----------------