Link to home
Start Free TrialLog in
Avatar of grobin
grobin

asked on

In Unlock necessary when closing locked files.

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?
ASKER CERTIFIED SOLUTION
Avatar of y96andha
y96andha

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial