In Unlock necessary when closing locked files.
Posted on 1997-08-16
I'm writing a VB4 CGI chat program and for the first time felt it necessary to lock files when reading and writing to them. When I lock my files I lock them in the Open statement i.e.
Open IndexFile For Random Lock Read Write As #FN.
When I was looking through the help files I came across the Lock # and Unlock # commands for locking individual records or bytes in a random access or binary file and noticed a warning that closing the file without using the Unlock # command could cause unpredictable results. Dose this apply only to files with individual records locked with the Lock # command after the open statement or should I unlock any files opened with the locking done in the Open statement as well?