Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit UFunktionalität;
- interface
- uses
- System.Classes,System.StrUtils,System.AnsiStrings,System.SysUtils;
- procedure CaseSensitiveSwitchFlip ;
- procedure CopyToClipboard;
- procedure Reset(Input: string; Output: string);
- procedure Sort(input: string);
- implementation
- uses
- UZeichenZähler, Vcl.Clipbrd;
- procedure CaseSensitiveSwitchFlip ;
- begin
- IstCaseSensitiveAktiv := not IstCaseSensitiveAktiv
- end;
- procedure CopyToClipboard;
- begin
- ClipBoard.AsText := Form3.ListeLb.Items.Text;
- end;
- procedure Reset(input: string; output: string);
- begin
- input:='';
- output:= '';
- end;
- procedure Sort(input: string);
- var
- ArrayIndex, inputIndex, Count: integer;
- Character: array[1..256] of string;
- text: string;
- begin
- if (input<>'') then begin
- if (input<>'') and (Form3.ListeLb.Items.Count <> 0) then
- Form3.ListeLb.Clear;
- ArrayIndex:= 0;
- repeat
- if input<>'' then begin
- ArrayIndex:= ArrayIndex +1;
- if not IstCaseSensitiveAktiv then
- input:= AnsiUpperCase(input);
- Character[ArrayIndex]:= input[1];
- Count:= 1;
- inputIndex:= 0;
- text:= (input);
- delete(text, 1, 1);
- input:= text;
- if AnsiContainsStr(input, Character[ArrayIndex]) and (Character[ArrayIndex] <> ' ') then begin
- repeat
- inputIndex:= inputIndex +1;
- if Character[ArrayIndex] = input[inputIndex] then begin
- Count:= Count + 1;
- text:= input;
- delete(text, inputIndex, 1);
- input:= text;
- inputIndex:= inputIndex - 1;
- end;
- until not (AnsiContainsStr(input, Character[ArrayIndex])) or (Character[ArrayIndex] = ' ');
- Form3.ListeLb.Items.Add(Character[ArrayIndex] + ': ' + IntToStr (Count))
- end
- else if (Character[ArrayIndex] <> ' ') then begin
- Form3.ListeLb.Items.Add(Character[ArrayIndex] + ': ' + IntToStr (Count))
- end;
- end;
- until (length(input) = 1) or (input = '');
- if input <> '' then begin
- ArrayIndex:= ArrayIndex + 1;
- Character[ArrayIndex]:= input[1];
- input := '';
- if Character[ArrayIndex] <> ' ' then
- Form3.ListeLb.Items.Add(Character[ArrayIndex] +': ' + IntToStr (1));
- end;
- end
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement