How to know whether a text file is opened

Hi there, I have a very urgent problem.

So I'm writing a program with text files.
The text file, "account", will need to be accessed and edited (rewrite, reset, append).

So if I have left the file opened before I enter the Edit Procedure of my program, there would be an error. (I know this but I need to prevent from this)

So if I don't enter the program, resetting and reading the file do not make any error. (of course)

Now I need to be noticed before I enter the procedure. I want to warn the user to stop/quit the "account" text file so that my program could successfully edit the file in the Edit Procedure.

I think I need a command that could "distinguish" or give me an error code (like IOresult) so I could fix this fatal error.

Any ideas would be appreciated. Thank you.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!