From bb3f27ddefa235a0db2e91d0565aadc73220830f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 10 Dec 2015 16:39:49 +0100 Subject: matheunit.pas und mystringlistunit.pas können jetzt auch Formeln auswerten MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mystringlistunit.pas | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'mystringlistunit.pas') diff --git a/mystringlistunit.pas b/mystringlistunit.pas index cdc0933..af2ce33 100644 --- a/mystringlistunit.pas +++ b/mystringlistunit.pas @@ -5,7 +5,7 @@ unit mystringlistunit; interface uses - Classes, SysUtils, RegExpr, Process, protokollunit; + Classes, SysUtils, RegExpr, Process, protokollunit, matheunit; type tMyStringList = class (tStringList) @@ -31,7 +31,8 @@ type function stillNeed(bez: string): boolean; function needInLine(bez: string; lin: longint): boolean; procedure insert(index: longint; const s: ansistring); override; - function unfoldMacros: boolean; + function unfoldMacros: boolean; overload; inline; + function unfoldMacros(kvs: tKnownValues; cbgv: tCallBackGetValue): boolean; overload; procedure subst(regex,ersatz: string); procedure dump(pro: tProtokollant; prefix: string); procedure nichtInSubRoutine(s: string); @@ -245,6 +246,11 @@ begin end; function tMyStringlist.unfoldMacros: boolean; +begin + result:=unfoldMacros(nil,nil); +end; + +function tMyStringlist.unfoldMacros(kvs: tKnownValues; cbgv: tCallBackGetValue): boolean; var i,j,k,l,Ebene: longint; s,t,u,v: string; @@ -268,9 +274,27 @@ begin inc(i); end; + i:=0; + while iself[i] then begin + wasGefunden:=true; + self[i]:=s; + end; + end; + if wasGefunden then continue; + i:=0; while i