User Tools

Site Tools


reading_20environment_20variables

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 for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
reading_20environment_20variables.txt · Last modified: 2018/04/15 11:05 by richardrussell