Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/104345

From BetaArchive Wiki
Knowledge Base


How to Determine If a Library Is Loaded in Memory

Article ID: 104345

Article Last Modified on 12/3/2003



APPLIES TO

  • Microsoft Visual FoxPro 3.0 Standard Edition
  • Microsoft FoxPro 2.5b
  • Microsoft FoxPro 2.5a
  • Microsoft FoxPro 2.5b
  • Microsoft FoxPro 2.6 Standard Edition
  • Microsoft FoxPro 2.6a Standard Edition
  • Microsoft FoxPro 2.0
  • Microsoft FoxPro 2.5b for MS-DOS
  • Microsoft FoxPro 2.5a
  • Microsoft FoxPro 2.5b for MS-DOS
  • Microsoft FoxPro 2.6 for MS-DOS



This article was previously published under Q104345

SUMMARY

To see if an external library (.PLB file in the MS-DOS environment, .FLL file in the Windows environment) has been loaded by means of the SET LIBRARY TO command, use the code example shown below.

MORE INFORMATION

The SET LIBRARY TO command allows API libraries to be loaded into memory. The following code example will allow a program to determine if a specific library has been loaded.

   * Use the set of commands appropriate for the product installed

   * From the FoxPro for MS-DOS root directory
   SET LIBRARY TO netware.plb ADDITIVE   &&Not avail. in 2.0 single user
   SET LIBRARY TO goodies\pdrivers\driver2.plb ADDITIVE

   * From the FoxPro for Windows root directory
   SET LIBRARY TO driver2.fll ADDITIVE
   SET LIBRARY TO foxtools.fll ADDITIVE

   *From the Visual FoxPro root directory
   SET LIBRARY TO reserved.fll ADDITIVE
   SET LIBRARY TO foxtools.fll ADDITIVE

   * In both MS-DOS and Windows:
   * To check if a library has been loaded:

   isloaded = "<the name of the library>" $ SET("LIBRARY")
   IF isloaded
      WAIT WINDOW "<Library name> has been loaded"
   ELSE
         WAIT WINDOW "<Library name> has not been loaded"
   ENDIF

   * To clear all libraries from memory
   SET LIBRARY TO

   * End code example
                

The SET("LIBRARY") function returns a string containing the names of all external API libraries currently loaded, with a comma between the library names. The $ operator is used to search anywhere within the string for the name of a specific library.


Additional query words: VFoxWin FoxDos FoxWin

Keywords: kbcode KB104345