home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / pascal / 5136 < prev    next >
Encoding:
Text File  |  1992-08-31  |  1008 b   |  25 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!decwrl!csus.edu!netcom.com!gabriel
  3. From: gabriel@netcom.com (Gabriel Beccar-Varela)
  4. Subject: Re: How can I see if a file is open?
  5. Message-ID: <29hn7+#.gabriel@netcom.com>
  6. Date: Tue, 01 Sep 92 01:09:02 GMT
  7. Organization: Netcom - Online Communication Services (408 241-9760 guest)
  8. References: <al161926.715305119@academ01>
  9. Lines: 14
  10.  
  11. In article <al161926.715305119@academ01> al161926@academ01.mty.itesm.mx (Jesus Barrera Ramos) writes:
  12. >I'm having some troubles with files because I need to know if a file is open or not, is there a way to know if a file is OPEN or CLOSED, that's the way I see when a request a Watch to a file variable. Thanks in advance.
  13.  
  14.    It is very simple: if your file is a textfile you check as follows:
  15.  
  16.                 if TextRec(myfile).mode <> fmClosed then...
  17.  
  18.     if your file is typed or untyped you say:
  19.  
  20.                  if FileRec(myfile) <> fmClosed then ...
  21.  
  22.    Check the TP 6.0 Programmer's Guide, page 141-148.
  23.  
  24. Good Luck.
  25.