GetEnvironmentVariable

BlitzMax Forums/BlitzMax Programming/GetEnvironmentVariable

siread(Posted 2008) [#1]
I'm trying to compile the following code, but max is saying unnexpected \. What's the correct way to do this?

Extern "Win32"
	Function GetEnvironmentVariable(lpName$z, lpBuffer:Byte Ptr, nSize) = \"GetEnvironmentVariableA@12\"
End Extern



siread(Posted 2008) [#2]
Ah, now I see when I post a thread that the forum has assumed the 'at' symbol was an email address. I just need to remove the slashes that I had seen in other people's code. :P


plash(Posted 2008) [#3]
Totally lost.


siread(Posted 2008) [#4]
Hehe. Basically I'd been trying to use Gellyware's Armadillo functions that use GetEnvironmentVariable, but because it has an @ symbol in the code the forum treats it as an email address and adds slashes to each end. So I was trying to compile code with slashes which shouldn't have been there.


Canardian(Posted 2008) [#5]
The last solution in this thread from Yan works fine:
http://www.blitzmax.com/Community/posts.php?topic=64930#724784


plash(Posted 2008) [#6]
Thats much clearer, why cant you just use getenv_()?

Actually GetEnviromentVariable() seems more complex..