XPost: microsoft.public.vb.general.discussion, microsoft.public.vb   
   From: nobody@cox.net   
      
   "expvb" wrote in message   
   news:uJXjLUpFJHA.616@TK2MSFTNGP06.phx.gbl...   
   > "Don" wrote in message   
   > news:48cd4c0a.2185703@news.west.cox.net...   
   >> I'm assuming you mean that Notepad can be used to open a file with   
   >> exclusive access.   
   >   
   > Not sure what you mean, but if you open the file exclusively, like the   
   > following, Notepad can't even read it:   
   >   
   > Option Explicit   
   >   
   > Dim f As Long   
   >   
   > Private Sub Command1_Click()   
   > f = FreeFile   
   > Open App.Path & "\Test.txt" For Binary Access Read Write Lock Read Write   
   > As f   
   >   
   > End Sub   
   >   
   > Private Sub Command2_Click()   
   > Close f   
      
   I forgot to add the following line here, so the file number is not closed   
   again in Form_Unload:   
      
   f = 0   
      
   > End Sub   
   >   
   > Private Sub Form_Unload(Cancel As Integer)   
   > If f <> 0 Then   
   > Close f   
   > End If   
   > End Sub   
   >   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|