How to fill all edits with random characters ranging from A to Z all with a space in front of the character?

Hi Folks!

Is it possible to fill each and every edit with  a space + a randomly chozen character ranging from > A to Z ?


Regards Peter

Provide a working sample > this will grant you the points ofcourse :)
PeterdeBAsked:
Who is Participating?
 
shaneholmesConnect With a Mentor Commented:
hello, why didn't i think of that ....... ha ha ha....

see what happens when your coding two different things at the same time

<SMILE>

sholmes
0
 
shaneholmesCommented:
procedure TForm1.Button1Click(Sender: TObject);
var
 I, C: Integer;
begin
 randomize;
 for I:= 0 to ComponentCount -1 do
  if Components[I] is TEdit then
  begin
   repeat
    C:= Random(90) + 1;
   until (C > 65) AND (C <= 90);
   TEdit(Components[I]).Text:= Char(C);
  end;
end;
0
 
BlackTigerXCommented:
procedure TForm1.Button1Click(Sender: TObject);
var
 I, C: Integer;
begin
 randomize;
 for I:= 0 to ComponentCount -1 do
  if Components[I] is TEdit then
  begin
    C:= Random(26)+65;
   TEdit(Components[I]).Text:= ' '+Char(C);
  end;
end;

=o)
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
BlackTigerXCommented:
lol, it happened to me just now in another question...

give the points to shaneholmes, I just polished the code
0
 
PeterdeBAuthor Commented:
Ok guys tnx for the responses. I will follow up to your advice BlackTigerX!

Perfect code!

Regards and respect,

Peter
0
 
shaneholmesCommented:
Thankx BlackTigerX!

Shane
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.