qp.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
ENVIRON.PAS
  Example Contents Index                                    Back
 
PROGRAM environ;
 
{ ENVIRON.PAS illustrates the following environment variable functions:
 
      EnvCount    EnvStr    GetEnv
}
 
USES
    Dos;
 
CONST
    program_name = 'ENVIRON ';
    program_desc = 'displays information about environment variables.';
 
VAR
    envvars : Integer;
    i       : Integer;
    pathvar : STRING;
 
BEGIN
 
    Writeln( program_name, program_desc );
    Writeln;
 
    { Find out how many environment variables are set. }
    envvars := EnvCount;
 
    { Show them. }
    IF (EnvCount <= 0) THEN
        Writeln( 'No environment variables set.' )
    ELSE FOR i := 1 TO EnvCount DO
        Writeln( EnvStr( i ) );
 
    { Get the QPL environment variable if it exists. }
    pathvar := GetEnv( 'QPL' );
    IF (pathvar = '') THEN
        BEGIN
        Writeln( 'If you use QuickPascal often, you might want' );
        Writeln( 'to define the QPL environment variable.' );
        END;
 
END.