Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!fauern!opal!fub!geminix.in-berlin.de!tertius!gaertner From: gaertner@tertius.in-berlin.de Newsgroups: comp.lang.pascal Subject: Re: Request: Help with Enumeration Type Message-ID: <6213@tertius.in-berlin.de> Date: 13 Dec 90 14:08:46 GMT Organization: Rechenzentrum MPG Berlin Lines: 53 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 ) ; TYPE Measure = ( low , high ) ; { our enumeration type } VAR result : FILE OF Measure ; { the logical file } BEGIN { create system dependent connection of logical/external file we create a new file } OPEN(FILE_VARIABLE:=result,FILE_NAME:='TEST.DAT',HISTORY:=NEW) ; { put `result' into generation-mode } REWRITE(result) ; { fill the file buffer } result^:=low ; { now write the value onto the file } PUT(result) ; { destroy system dependent connection of logical/external file } CLOSE(result) ; { create a new connection of logical/external file we want to read the previously written value } OPEN(FILE_VARIABLE:=result,FILE_NAME:='TEST.DAT',HISTORY:=OLD) ; { put `result' into inspection-mode; also the file buffer is filled with the first element } RESET(result) ; { check the element } IF result^=low WRITELN(' got the value ') ; { destroy system dependent connection of logical/external file } CLOSE(result) ; END. ----- Ralf Gaertner e-mail: gaertner@fhi-berlin.mpg.dbp.de Fritz-Haber-Institute (FRG)