Environment variables

BlitzMax Forums/BlitzMax Programming/Environment variables

Is there any way, using the API of Windows, to read the value of any environment variable from within BLIde?
I've tryed this:

Import "-lshell32"
Extern "win32"
	Function GetEnvironmentVariable Variable:String,Result:String,BufSize:Long) = "GetEnvironmentVariable@16"
end extern


but it doesn't compile...

Try:

putenv_ "Myvar=hello"
Print getenv_("Myvar")


Thanks!