diff options
-rw-r--r-- | lowlevelunit.pas | 14 | ||||
-rw-r--r-- | mystringlistunit.pas | 9 |
2 files changed, 23 insertions, 0 deletions
diff --git a/lowlevelunit.pas b/lowlevelunit.pas index 7115952..27d7d85 100644 --- a/lowlevelunit.pas +++ b/lowlevelunit.pas @@ -93,6 +93,7 @@ function mirrorBits(w: word): word; overload; function mirrorBits(b: byte): byte; overload; function zusammenfassen(s1,s2: string): string; +function intervallAusrollen(s: string): string; var base64Chars: array[0..63] of char; @@ -815,6 +816,19 @@ begin else raise exception.create('Ich kann '''+s1+''' und '''+s2+''' nicht zusammenfassen!'); end; +function intervallAusrollen(s: string): string; +var + i: longint; +begin + i:=strtoint(erstesArgument(s,'..')); + result:=''; + while i<=strtoint(s) do begin + result:=result+' '+myinttostr(i,length(s),'0'); + inc(i); + end; + result:=trim(result); +end; + var b: byte; begin diff --git a/mystringlistunit.pas b/mystringlistunit.pas index 9693fca..65f5c36 100644 --- a/mystringlistunit.pas +++ b/mystringlistunit.pas @@ -334,6 +334,15 @@ begin end; delete(i); + u:=s; + s:=''; + while length(u)>0 do begin + v:=erstesArgument(u); + if pos('..',v)<>0 then v:=intervallAusrollen(v); + s:=s+' '+v; + end; + s:=trim(s); + while length(s)>0 do begin // Schleifenzähler laufen lassen u:=erstesArgument(s); for j:=0 to SchleifenInhalt.Count-1 do begin // Schleifenkörper ... |