unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
ListBox1: TListBox;
ListBox2: TListBox;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
procedure Memo1Change(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
wor,s:string;
l,x,i,c,k,e,j,n,merke:integer;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
listbox1.Clear;
wor:=upcase(memo1.text);
s:=wor;
l:=1;
for i:=1 to length(s) do
begin
x:=ord(s[i]);
begin
If x>=65 Then If x<=90 Then
listbox1.items.Add(inttostr(x));
end;
end;
begin
c:=listbox1.Count;
edit2.text:=inttostr(c);
end;
begin
//Hier muss etwas wie ein sortieralgorithmus hin. Aber es will nicht klappen.
end;
for j:=1 to c do
begin
if s[j]<s[j+1] Then l:=l Else
if s[j]<s[j+1] Then l:=l+1;
end;
edit1.text:=inttostr(l);
end;
procedure TForm1.Memo1Change(Sender: TObject);
begin
end;
end.