Control of array elements

Please discuss general Delphi programming topics here.

Control of array elements

Postby enigma55 » December 7th, 2015, 7:40 pm

Hello friends.First of all,I am sorry for my English is not too good. I had installed Delphi 7 user and I can buy an issue important for my project. How many days I searched the internet but I could not make one kind of solution. I request your help. The point is, let me first code;

procedure TForm1.Button1Click(Sender: TObject);
var
i :Byte;
katar,sonuc:String;
s :Array[0..2]of String;
begin
randomize;
katar:='abc';
for i:=0 to 2 do
begin
s[i]:= katar[random(3)+1];
sonuc:=sonuc+s[i];
end;
li1.Items.Add(sonuc);
end;

I want to generate a random string and show the listbox. So far so good. But,I want; It will produce the same string again.
for example;
acb
bbb
bca
ccb
acb
.... ok. As you can see, but there was repeated string! I just want to prevent it. How can i it?
Thanks...
Teşekkürler.
enigma55
Member
Member
 
Posts: 1
Joined: December 7th, 2015, 7:17 pm

Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron