function GetEnvVar$(name$) lbuf$ = space$(255) + chr$(0) name$ = name$ + chr$(0) calldll #kernel32, "GetEnvironmentVariableA",_ name$ as ptr, _ lbuf$ as ptr, _ 256 as long, _ result as long if result = 0 then GetEnvVar$ = "Environment Variable Not Found" else GetEnvVar$ = left$(lbuf$,result) end if
It works, but as a beginner i aspect to use GetComputerNameA. I did found this code, but how to get it with GetComputerNameA ? GetEnvironmentVariableA contains more info, but where can i find it?
You appear to be new to making API calls. Start with the ABCs of APIs series above. You first need to understand the mechanics of using calldll in Liberty BASIC. It's the most complex subject for programming in LB and you'll need to put some time into understanding it.
API functions are not part of Liberty BASIC. LB makes it possible to USE these functions, but they are part of Windows itself, or part of third party libraries, so the documentation can be found with the third party library or on the Microsoft Developers Network, "MSDN."