Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
|||
print StartupDir$
|
||||
print DefaultDir$
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
print GetEnvironmentVariable$("USERNAME")
|
||||
print GetEnvironmentVariable$("USERPROFILE") ' equivalent to UNIX HOME variable
|
||||
print GetEnvironmentVariable$("PATH")
|
||||
end
|
||||
|
||||
function GetEnvironmentVariable$(lpName$)
|
||||
'get the value of an environment variable
|
||||
nSize = 1024
|
||||
|
||||
[Retry]
|
||||
lpBuffer$ = space$(nSize)
|
||||
|
||||
calldll #kernel32, "GetEnvironmentVariableA", _
|
||||
lpName$ as ptr, _
|
||||
lpBuffer$ as ptr, _
|
||||
nSize as ulong, _
|
||||
result as ulong
|
||||
|
||||
select case
|
||||
' buffer too small
|
||||
case result > nSize
|
||||
nSize = result
|
||||
goto [Retry]
|
||||
|
||||
' variable found
|
||||
case result > 0
|
||||
GetEnvironmentVariable$ = left$(lpBuffer$, result)
|
||||
end select
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue