[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2005-04-08
6
Medium Priority
?
170 Views
Last Modified: 2010-04-05
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 :)
0
Comment
Question by:PeterdeB
  • 3
  • 2
6 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 13738087
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
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 13738230
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
 
LVL 11

Accepted Solution

by:
shaneholmes earned 200 total points
ID: 13738279
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:BlackTigerX
ID: 13738326
lol, it happened to me just now in another question...

give the points to shaneholmes, I just polished the code
0
 

Author Comment

by:PeterdeB
ID: 13738982
Ok guys tnx for the responses. I will follow up to your advice BlackTigerX!

Perfect code!

Regards and respect,

Peter
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 13739098
Thankx BlackTigerX!

Shane
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question