From c32e27b77d08e0583e55c9459e166924ab8840bd Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 23 Jul 2015 14:29:32 +0200 Subject: shellSubst in systemunit.pas eingefuegt --- systemunit.pas | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'systemunit.pas') diff --git a/systemunit.pas b/systemunit.pas index 645f09e..220ab0f 100644 --- a/systemunit.pas +++ b/systemunit.pas @@ -12,6 +12,7 @@ function numCpus: int64; function momentanFreieCpus: int64; function belegterSpeicher: int64; function minCache: int64; +function shellSubst(s: string): string; implementation @@ -115,6 +116,19 @@ begin closefile(f); end; +function shellSubst(s: string): string; +var name: string; +begin + result:=s; + while pos('${',result)>0 do begin + s:=leftStr(result,pos('${',result)-1); + delete(result,1,pos('${',result)-1+length('${')); + name:=leftStr(result,pos('}',result)-1); + delete(result,1,length(name+'}')); + result:=s+GetEnvironmentVariable(name)+result; + end; +end; + begin _cpuLastUsed:=0; _cpuLastIdle:=0; -- cgit v1.2.3-70-g09d2