Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14004

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to know whether a text file is opened Posted by blackr12345 on 18 Sept 2011 at 8:26 AM
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.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.