diff options
Diffstat (limited to 'mystringlistunit.pas')
-rw-r--r-- | mystringlistunit.pas | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/mystringlistunit.pas b/mystringlistunit.pas index 47bc37c..a8ef5ae 100644 --- a/mystringlistunit.pas +++ b/mystringlistunit.pas @@ -24,7 +24,7 @@ type line: longint; prot: tProtokollant; public - constructor create(protokollant: tProtokollant); + constructor create(protokollant: tProtokollant; name: string); procedure loadFromFile(const s: ansiString); override; procedure loadFromGz(const s: ansiString); procedure saveToGz(const s: ansiString); @@ -35,6 +35,7 @@ type function stillNeed(bez: string): boolean; function unfoldMacros: boolean; procedure subst(regex,ersatz: string); + procedure dump(pro: tProtokollant; prefix: string); end; procedure _del(var s: string; p,c: longint); inline; // identisch zu delete(s,p,c) -- lediglich um delete innerhalb von tMyStringlist verfügbar zu haben @@ -77,10 +78,13 @@ end; // tMyStringlist *************************************************************** -constructor tMyStringlist.create(protokollant: tProtokollant); +constructor tMyStringlist.create(protokollant: tProtokollant; name: string); begin inherited create; - prot:=tProtokollant.create(protokollant,'tMyStringlist'); + if assigned(protokollant) then + prot:=tProtokollant.create(protokollant,name) + else + prot:=nil; line:=0; end; @@ -91,7 +95,10 @@ begin for i:=0 to count-1 do self[i]:=trim(self[i]); line:=0; - writeln(inttostr(count)+' Zeilen eingelesen'); + if assigned(prot) then + prot.schreibe(inttostr(count)+' Zeilen eingelesen') + else + writeln(inttostr(count)+' Zeilen eingelesen'); end; procedure tMyStringlist.loadFromGz(const s: ansiString); @@ -273,7 +280,7 @@ begin t:=erstesArgument(s,':'); if (length(t)=0) or (t[1]<>'$') then exit; - SchleifenInhalt:=tMyStringlist.create(nil); // Schleifenkörper merken + SchleifenInhalt:=tMyStringlist.create(nil,''); // Schleifenkörper merken Ebene:=0; while (i<Count) and ((Ebene<>0) or (self[i]<>'!Schleifenende')) do begin SchleifenInhalt.Add(self[i]); @@ -417,6 +424,14 @@ begin re.free; end; +procedure tMyStringlist.dump(pro: tProtokollant; prefix: string); +var + i: longint; +begin + for i:=0 to count-1 do + pro.schreibe(prefix+self[i]); +end; + // allgemeine Funktionen ******************************************************* procedure _del(var s: string; p,c: longint); |