Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

function to check whether file is already open 1

Status
Not open for further replies.

fbizzell

Programmer
Jul 3, 2000
217
Is there a clipper or 3rd party function that checks to see if the program already has a file open. I sometimes get an error that "alias does not exist". It is usually because I have opened a user area and then closed it when I should have left it open. I want to be able to check whether the file is open when I try to use it and if it is not I then can open it.
 
I usually test to see if a field in the table is 'visible'...

Code:
IF TYPE("MyTable->MyField") = "U"
  SELECT 0
  USE MyTable
ENDIF

Regards

Griff
Keep [Smile]ing
 
Better would bet to try
Code:
IF Select(cDataFile) = 0
  SELECT 0
  USE (cDataFile)
ENDIF

HTH
TonHu
 
Thanks TonHu, I will give that one a try as well and see if it works for me.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top