PeterdeB
asked on
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 :)
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 :)
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)
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:
end;
end;
=o)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
lol, it happened to me just now in another question...
give the points to shaneholmes, I just polished the code
give the points to shaneholmes, I just polished the code
ASKER
Ok guys tnx for the responses. I will follow up to your advice BlackTigerX!
Perfect code!
Regards and respect,
Peter
Perfect code!
Regards and respect,
Peter
Thankx BlackTigerX!
Shane
Shane
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:
end;
end;