[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
GETENV()
Retrieve the contents of a DOS environment variable
------------------------------------------------------------------------------
Syntax
GETENV(<cEnvironmentVariable>) --> cString
Arguments
<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.
Returns
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 ("").
Description
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.
Notes
. 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
command.
. Compatibility: In previous releases of CA-Clipper, the
function was called GETE(). This abbreviated form of GETENV() is
still operational.
Examples
. This example retrieves the current DOS PATH setting, making it
the current CA-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
this:
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
follows:
cDdfDirectory := GETENV("LOC_DBF")
USE (cDdfDirectory + "Invoices")
Files Library is CLIPPER.LIB.
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson