Retrieve the contents of a DOS environment variable

     GETENV(<cEnvironmentVariable>) --> cString


     <cEnvironmentVariable> is the name of the DOS environment variable.
     When specifying this argument, you can use any combination of uppercase
     and lowercase letters; GETENV() is not case-sensitive.


     GETENV() returns the contents of the specified DOS environment variable
     as a character string.  If the variable cannot be found, GETENV()
     returns a null string ("").


     GETENV() is an environment function that lets you retrieve information
     from the DOS environment into an application program.  Typically, this
     is configuration information, including path names, that gives the
     location of files (database, index, label, or reports).  This function
     is particularly useful for network environments.


     .  Empty return value: If you are certain that an environment
        variable exists and yet GETENV() always returns a null string (""),
        be sure there are no spaces between the environment variable name and
        the first character of the string assigned to it in the DOS SET

     .  Compatibility: In previous releases of Clipper, the
        function was called GETE().  This abbreviated form of GETENV() is
        still operational.


     .  This example retrieves the current DOS PATH setting, making it
        the current Clipper PATH:

        cPath := GETENV("PATH")
        SET PATH TO (cPath)

     .  This example uses environment variables to configure the
        specific locations of files.  When you set up a system, define
        environment variables that contain the location of various file types
        as well as the CLIPPER environment variable (see "The Runtime
        Environment" chapter in the Programming and Utilities Guide), like

        C>SET LOC_DBF=<database file path>
        C>SET LOC_NTX=<index file path>
        C>SET LOC_RPT=<report file path>

        In the configuration section of your application program, assign the
        contents of the environment variables to variables.  Then when you
        access a file, preface the reference with the path variable as

        cDdfDirectory := GETENV("LOC_DBF")
        USE (cDdfDirectory + "Invoices")

 Files   Library is CLIPPER.LIB.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.