home *** CD-ROM | disk | FTP | other *** search
- /*
-
- Author: DAVID -(FLASH)- GORDON CompuServ ID - 75130,3664
-
- Originally: Program COPYRIGHT 1991, FlashPoint
-
- Now and Forever: Released into the Public Domain
-
- Note: FlashPoint is a Registered Trademark
-
- Purpose: IsOpen() was designed to ensure a database would not be
- unintentionally opened a second time on a network by the
- same user. This version is limited to the user having a
- maximum of 20 databases opened at one time. It will select
- the database so you can go on with whatever you were doing.
- */
-
- * Usage In Your Application
- ******************************************************************************
-
- IF ! IsOpen("cFile")
- IF ! NetUse(cFile, "cFile", .f., "Attempt To Open File", 1)
- QUIT
- ENDIF
- ENDIF
-
- IF IsOpen("cFile")
- DBCLOSEAREA()
- ENDIF
-
- ******************************************************************************
-
- FUNCTION IsOpen(cPassAlias)
- LOCAL nI := 1, cAlias := "", nArea := 0
- FOR nI := 1 to 20
- cAlias := alias(nI)
- IF UPPER(ALLTRIM(cAlias)) == UPPER(ALLTRIM(cPassAlias))
- nArea := DBSELECTAREA(cAlias)
- DBSELECTAREA(nArea)
- RETU .T.
- ENDIF
- NEXT
- RETURN .F.
-
-