User Tools

Site Tools


reading_20environment_20variables

This is an old revision of the document!


Reading Environment Variables

by Richard Russell, May 2011

You can read the environment variables associated with the current process using code similar to this:

      PRINT FNenvironment("PATH")
      PRINT FNenvironment("USERNAME")
      END
      DEF FNenvironment(envar$)
      LOCAL buffer%, size%
      SYS "GetEnvironmentVariable", envar$, 0, 0 TO size%
      DIM buffer% LOCAL size%
      SYS "GetEnvironmentVariable", envar$, buffer%, size%+1
      = $$buffer%
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
reading_20environment_20variables.1522502376.txt.gz · Last modified: 2024/01/05 00:16 (external edit)