Jump to content

DosScanEnv: Difference between revisions

From EDM2
Created page with "==Description== This call scans (searches) an environment segment for an environment variable. ==Syntax== DosScanEnv (EnvVarName, ResultPointer) ==Parameters== ; EnvVarNam..."
 
Line 29: Line 29:
                   À---- ResultPointer points here after the
                   À---- ResultPointer points here after the
                             following call to DosScanEnv:
                             following call to DosScanEnv:
 
             DosScanEnv("DPATH", &ResultPointer);
             DosScanEnv("DPATH", &ResultPointer);



Revision as of 15:04, 9 June 2016

Description

This call scans (searches) an environment segment for an environment variable.

Syntax

DosScanEnv (EnvVarName, ResultPointer)

Parameters

EnvVarName (PSZ) - input
Address of the name of the environment variable. Do not include a trailing " = ", since this is not part of the name.
ResultPointer (PSZ FAR *) - output
Address where the system returns the pointer to the environment string. ResultPointer points to the first character of the string that is the value of the environment variable and can be passed directly into DosSearchPath.

Return

rc (USHORT) - return

Return code descriptions are:

  • 0 NO_ERROR
  • 203 ERROR_ENVVAR_NOT_FOUND

Remarks

Assume that the process' environment contains:

           "DPATH=c:\sysdir;c:\libdir"
                  |
                  ³
                  ³
                  À---- ResultPointer points here after the
                           following call to DosScanEnv:

           DosScanEnv("DPATH", &ResultPointer);

As noted above, ResultPointer points to the first character of the value of the environment variable.

Categoty:The OS/2 API Project