home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!swrinde!gatech!purdue!yuma!yuma.acns.colostate.edu!hemstree
- From: hemstree@lamar.acns.colostate.edu (Charles Hemstreet)
- Subject: trying to use ioresult in HP-UX Pascal...
- Sender: news@yuma.ACNS.ColoState.EDU (News Account)
- Message-ID: <HEMSTREE.92Nov17060426@lamar.lamar.acns.colostate.edu>
- Date: Tue, 17 Nov 1992 11:04:26 GMT
- Nntp-Posting-Host: lamar.acns.colostate.edu
- Organization: Colorado State University
- Lines: 51
-
-
- I am using the following program out of the HP manual and I can't seem
- to get it to work...
-
- $sysprog$
- program trapmethod1(input,output);
- var Name: String[80];
- F: text;
- IOerror: integer;
- begin
- repeat
- write('open what ".TEXT" file ?');
- readln(Name);
- try
- reset(F, Name+'.TEXT');
- IOerror:=0; {if we get here the reset didn't fail}
- writeln(' File successfully opened!');
- recover
- if escapecode=-10 then {it's an i/o system error}
- begin
- IOerror := ioresult; {save it (IORESULT affected by writeln).}
- writeln(' Can''t open that file. IOresult:',IOerror:0);
- end
- else
- escape(escapecode); {pass non i/o errors back to system}
- until IOerror=0;
- end.
- --end trap.p---
- I get the following error message...
-
- ---errors - trap.p---
- cd /users/hemstree/work/countw/pascal/
- pc -v trap.p -o trap
- pc: /usr/lib/pascomp trap.p
- pascomp: IOerror := ioresult <<<<
- 17 - "trap.p(17)": Language extension not enabled;
-
- Compilation exited abnormally with code 1 at Tue Nov 17 05:46:05
- ---end errors - trap.p---
-
- How do I enable this language extension?
-
- Thanks for the help,
-
- Charles
-
- --
- !===========================================================================!
- ! Charles H. Hemstreet IV !internet: hemstree@cs.Colostate.Edu !
- ! Colorado State University ! or hemstree@lamar.Colostate.Edu !
- !===========================================================================!
-