Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - getenv() return the value of a dos environment variable http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getenv()            Return the value of a DOS environment variable
------------------------------------------------------------------------------
 Declaration
   system.hdr

 Syntax
   func char getenv extern
   param const char cEnvironmentVariable

 Arguments
   cEnvironmentVariable is the environment string to scan for.

 Return
   The current value of the specified environment setting.

 Description
   The getenv() function returns the current value of the DOS environment
   variable cEnvironmentVariable. If the variable is not defined, an empty
   string is returned.

 Example
   #define EXAMPLE_SYSTEM
   #include example.hdr

   proc Test_getenv
   vardef
      char cPath
   enddef
   ? "Path is", getenv( "path" )
   ? "Prompt is", getenv( "prompt" )
   // The Force compiler searches the environment for the "force.hdr" path.
   // This tells the compiler where the .hdr files exist.
   cPath := getenv( "force.hdr" )
   if .not. isempty( cPath )
      ?
      ? ".hdr files exist in directory", cPath
   endif
   endproc

   proc main
   Test_getenv()
   endproc

See Also: envcount() envsize() getenvc() parseenv()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson