home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / pascal / 6648 < prev    next >
Encoding:
Text File  |  1992-11-17  |  2.0 KB  |  63 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!swrinde!gatech!purdue!yuma!yuma.acns.colostate.edu!hemstree
  3. From: hemstree@lamar.acns.colostate.edu (Charles Hemstreet)
  4. Subject: trying to use ioresult in HP-UX Pascal...
  5. Sender: news@yuma.ACNS.ColoState.EDU (News Account)
  6. Message-ID: <HEMSTREE.92Nov17060426@lamar.lamar.acns.colostate.edu>
  7. Date: Tue, 17 Nov 1992 11:04:26 GMT
  8. Nntp-Posting-Host: lamar.acns.colostate.edu
  9. Organization: Colorado State University
  10. Lines: 51
  11.  
  12.  
  13. I am using the following program out of the HP manual and I can't seem
  14. to get it to work...
  15.  
  16. $sysprog$
  17. program trapmethod1(input,output);
  18. var Name:    String[80];
  19. F:        text;
  20. IOerror:    integer;
  21. begin
  22.     repeat
  23.     write('open what ".TEXT" file ?');
  24.     readln(Name);
  25.     try
  26.         reset(F, Name+'.TEXT');
  27.             IOerror:=0; {if we get here the reset didn't fail}
  28.             writeln(' File successfully opened!');
  29.         recover
  30.             if escapecode=-10 then {it's an i/o system error}
  31.             begin
  32.                 IOerror := ioresult; {save it (IORESULT affected by writeln).}
  33.                 writeln(' Can''t open that file. IOresult:',IOerror:0);
  34.             end
  35.             else
  36.             escape(escapecode); {pass non i/o errors back to system}
  37.     until IOerror=0;
  38. end.
  39. --end trap.p---
  40. I get the following error message...
  41.  
  42. ---errors - trap.p---
  43. cd /users/hemstree/work/countw/pascal/
  44. pc -v trap.p -o trap
  45. pc: /usr/lib/pascomp trap.p
  46. pascomp:                IOerror := ioresult <<<<
  47.     17 - "trap.p(17)": Language extension not enabled;
  48.  
  49. Compilation exited abnormally with code 1 at Tue Nov 17 05:46:05
  50. ---end errors - trap.p---
  51.  
  52. How do I enable this language extension?
  53.  
  54. Thanks for the help,
  55.  
  56. Charles
  57.  
  58. --
  59. !===========================================================================!
  60. ! Charles H. Hemstreet IV       !internet: hemstree@cs.Colostate.Edu        !
  61. ! Colorado State University     !       or hemstree@lamar.Colostate.Edu     !
  62. !===========================================================================!
  63.