I'm probably misreading the MSDN docs on this ( not for the first time ) but this doesn't work :
More specifically, it crashes and the debugger shuts itself down, so there's no possible way to see what it did or where it got to. I'm pretty sure it exits the function after being called, but since it shuts down, something obviously went wrong. And it doesn't get the correct value anyway.
EDIT: Correction, it does NOT exit the function. The debugger just writes something to the debuglog for no apparent reason before it crashes. Go figure.
Extern "Win32" Function GetEnvironmentVar:Int(Variable$z,Value$z,Length:Int) = "GetEnvironmentVariableA@12" End Extern Function GetEnvironmentVariable:String(EnvVarName:String) Local Ret:String Local L:Int=32767 If GetEnvironmentVar(EnvVarName,Ret,L)=0 Return "" Else Return Ret End If End Function
More specifically, it crashes and the debugger shuts itself down, so there's no possible way to see what it did or where it got to. I'm pretty sure it exits the function after being called, but since it shuts down, something obviously went wrong. And it doesn't get the correct value anyway.
EDIT: Correction, it does NOT exit the function. The debugger just writes something to the debuglog for no apparent reason before it crashes. Go figure.