Advertisement
Guest User

Untitled

a guest
Dec 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. unit UFunktionalität;
  2.  
  3. interface
  4. uses
  5. System.Classes,System.StrUtils,System.AnsiStrings,System.SysUtils;
  6.  
  7. procedure CaseSensitiveSwitchFlip ;
  8. procedure CopyToClipboard;
  9. procedure Reset(Input: string; Output: string);
  10. procedure Sort(input: string);
  11. implementation
  12.  
  13. uses
  14. UZeichenZähler, Vcl.Clipbrd;
  15.  
  16. procedure CaseSensitiveSwitchFlip ;
  17. begin
  18. IstCaseSensitiveAktiv := not IstCaseSensitiveAktiv
  19. end;
  20.  
  21. procedure CopyToClipboard;
  22. begin
  23. ClipBoard.AsText := Form3.ListeLb.Items.Text;
  24. end;
  25.  
  26. procedure Reset(input: string; output: string);
  27. begin
  28. input:='';
  29. output:= '';
  30. end;
  31.  
  32. procedure Sort(input: string);
  33. var
  34. ArrayIndex, inputIndex, Count: integer;
  35. Character: array[1..256] of string;
  36. text: string;
  37. begin
  38. if (input<>'') then begin
  39. if (input<>'') and (Form3.ListeLb.Items.Count <> 0) then
  40. Form3.ListeLb.Clear;
  41. ArrayIndex:= 0;
  42. repeat
  43. if input<>'' then begin
  44. ArrayIndex:= ArrayIndex +1;
  45. if not IstCaseSensitiveAktiv then
  46. input:= AnsiUpperCase(input);
  47. Character[ArrayIndex]:= input[1];
  48. Count:= 1;
  49. inputIndex:= 0;
  50. text:= (input);
  51. delete(text, 1, 1);
  52. input:= text;
  53. if AnsiContainsStr(input, Character[ArrayIndex]) and (Character[ArrayIndex] <> ' ') then begin
  54. repeat
  55. inputIndex:= inputIndex +1;
  56. if Character[ArrayIndex] = input[inputIndex] then begin
  57. Count:= Count + 1;
  58. text:= input;
  59. delete(text, inputIndex, 1);
  60. input:= text;
  61. inputIndex:= inputIndex - 1;
  62. end;
  63. until not (AnsiContainsStr(input, Character[ArrayIndex])) or (Character[ArrayIndex] = ' ');
  64. Form3.ListeLb.Items.Add(Character[ArrayIndex] + ': ' + IntToStr (Count))
  65. end
  66. else if (Character[ArrayIndex] <> ' ') then begin
  67. Form3.ListeLb.Items.Add(Character[ArrayIndex] + ': ' + IntToStr (Count))
  68. end;
  69. end;
  70. until (length(input) = 1) or (input = '');
  71. if input <> '' then begin
  72. ArrayIndex:= ArrayIndex + 1;
  73. Character[ArrayIndex]:= input[1];
  74. input := '';
  75. if Character[ArrayIndex] <> ' ' then
  76. Form3.ListeLb.Items.Add(Character[ArrayIndex] +': ' + IntToStr (1));
  77. end;
  78. end
  79. end;
  80.  
  81. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement