Hi ,
In one source , not mine , exist this function . But MinGW linker direct that this function is undefined . Maybe this can be changed with other , smilar function ?
With best regards !
#Include "FiveWin.ch"
#Include "xBrowse.ch"
Function Main()
Local aArr
aArr:={ ;
{"Temp" , GetEnv("TEMP") },;
{"WinDir" , GetEnv("WINDIR") },;
{"SystemRoot" , GetEnv("SYSTEMROOT") },;
{"AllUsersProfile" , GetEnv("ALLUSERSPROFILE") },;
{"UserProfile" , GetEnv("USERPROFILE") },;
{"LocalAppData" , GetEnv("LOCALAPPDATA") },;
{"AppData" , GetEnv("APPDATA") },;
{"ProgramFiles" , GetEnv("ProgramFiles") },;
{"CommonProgramFiles" , GetEnv("CommonProgramFiles") },;
{"HomeDrive" , GetEnv("HOMEDRIVE") },;
{"HomePath" , GetEnv("HOMEPATH") },;
{"LogonServer" , GetEnv("LOGONSERVER") },;
{"ComputerName" , GetEnv("ComputerName") },;
{"Path" , GetEnv("PATH") },;
{"OS" , GetEnv("OS") },;
{"SessionName" , GetEnv("SESSIONNAME") },;
{"UserName" , GetEnv("USERNAME") },;
{"Processor_Architecture" , GetEnv("PROCESSOR_ARCHITECTURE") },;
{"Include" , GetEnv("INCLUDE") },;
}
XBrowser aArr
Return NIL
#Define CRLF Chr(13)+ Chr(10)
//-------------------------------------------------------------------------//
// Para conocer todas las variables de entorno
FUNCTION GetOSEnvironment()
Local cTmp:= "TMPENV$$.Txt"
Local aTmp
Local aEnv:= {}
Local nI
Local cNombre, cValor, nAt
Local cBat:= "BATENV$$.Bat"
Local cComando:= "SET > "+ cTmp
Local hBat
*
hBat:= FCreate(cBat)
FWrite(hBat, cComando)
FClose(hBat)
*
RUN (cBat)
*
aTmp:= Cad2Arr(MemoRead(cTmp), CRLF)
*
FOR nI:= 1 TO Len(aTmp)
nAt:= At("=", aTmp[nI])
cNombre:= Left(aTmp[nI], nAt- 1)
cValor:= SubStr(aTmp[nI], nAt+ 1)
aAdd(aEnv,{cNombre, cValor})
NEXT
RETURN aEnv
*
//-------------------------------------------------------------------------//
// Funcion sin testear
STATIC FUNCTION Cad2Arr(cCadena, cSeparador)
Local nPos, aCadena:= {}, cSub
nPos:= At(cSeparador, cCadena)
do while nPos != 0
cSub:= substr(cCadena, 1, nPos- 1)
Aadd(aCadena, cSub)
cCadena:= substr(cCadena, nPos+ Len(cSeparador))
nPos:= At(cSeparador, cCadena)
enddo
cSub:= Left(cCadena, Len(cCadena))
Aadd(aCadena, cSub)
RETURN aCadena
*
anserkk wrote:GetEnv("TEMP")
May be useful for others
Anser
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 82 guests