lisp2arx
Visual Programming for AutoLisp Mathématiques en programmation Lisp.. doc2cpp,doc2lsp, sld2lsp, bmp2dcl, free__GifCcapture for all-CAD'platforms..
Lista Forumurilor Pe Tematici
lisp2arx | Reguli | Inregistrare | Login

POZE LISP2ARX

Nu sunteti logat.
Nou pe simpatie:
deea_mha pe Simpatie.ro
Femeie
25 ani
Dolj
cauta Barbat
18 - 80 ani
lisp2arx / Delphi , InnoPascal / Delphi32-retrieve Environmental Variables as strings by name  
Autor
Mesaj Pagini: 1
zauchan
Moderator

Inregistrat: acum 13 ani
Postari: 180
{ This code is very useful if you need to "translate" various
environmental variables. I use this a lot to get paths to TEMP
or windows folders on different systems.}

Code:

Function php_getenv(dfn_var_isstr:shortstring;local_only :wordbool):string;
var BufSize: Integer;  // buffer size required for value
begin
  // Get required buffer size (inc. terminal #0)
  dfn_var_isstr:=concat(dfn_var_isstr,#0,#0,#0);
  BufSize := GetEnvironmentVariable(@dfn_var_isstr[1], nil, 0);
  if BufSize > 0 then
  begin
    // Read env var value into result string
    SetLength(Result, BufSize - 1);
    GetEnvironmentVariable(@dfn_var_isstr[1],PChar(Result), BufSize);
  end
  else
    // No such environment variable
    Result := '';
end;//far.exe("'Path',Path php_getenv_path")



_______________________________________
psw: cea de la wjndowsXP gigabyte..

pus acum 3 ani
   
Pagini: 1  

Mergi la