home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / pascal / 6530 < prev    next >
Encoding:
Text File  |  1992-11-12  |  1.4 KB  |  45 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!think.com!ames!purdue!yuma!yuma.acns.colostate.edu!hemstree
  3. From: hemstree@lamar.acns.colostate.edu (Charles Hemstreet)
  4. Subject: Need to trap File DNE error...
  5. Sender: news@yuma.ACNS.ColoState.EDU (News Account)
  6. Message-ID: <HEMSTREE.92Nov12085754@lamar.lamar.acns.colostate.edu>
  7. Date: Thu, 12 Nov 1992 13:57:54 GMT
  8. Nntp-Posting-Host: lamar.acns.colostate.edu
  9. Organization: Colorado State University
  10. Lines: 33
  11.  
  12.  
  13. I am using HP Pascal (on an HP9000/370) and writing a program that is
  14. accessing files.  I haven't been able to find the HP Pascal manual so
  15. here I am...
  16.  
  17. I am calling a file with reset.  If the file Does not exist I would
  18. like to trap the error and report it in a friendly manner.  Is there
  19. an easy of doing this?  I tried using ioresult but I get the message
  20. "this feature is not enabled -ioresult"
  21.  
  22. I have...
  23.  
  24. begin
  25.     reset(intern,filename);
  26.     if ioresult <> 0 then
  27.     begin
  28.         writeln('the file :',filename,' is not available.');
  29.         halt; {is there a better way than halting?}
  30.     end
  31.     else
  32.     writeln('I have opened ",filename,'.');
  33. end;
  34.  
  35.  
  36. Thanks for the help,
  37.  
  38. Charles
  39.  
  40. --
  41. !===========================================================================!
  42. ! Charles H. Hemstreet IV       !internet: hemstree@cs.Colostate.Edu        !
  43. ! Colorado State University     !       or hemstree@lamar.Colostate.Edu     !
  44. !===========================================================================!
  45.