Posted on 1998-10-24
Medium Priority
Last Modified: 2010-04-06
I have many files pas in my program.
And almost each files using random function.
Where I should put Randomize function.
Just in main file or each files pas that using random function.

Question by:joely
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 17

Expert Comment

ID: 1344187
Hello Joely

Do you mean the program form or it's main unit(unit1)
because i doubt it would work only in the main unit(unit1)
If you only put it in the main file does it work ???

¤¤¤¤¤¤¤ InThe ¤¤¤¤¤¤¤
LVL 10

Accepted Solution

viktornet earned 40 total points
ID: 1344188
You need to put it in each function that you need to use Random() as in...

procedure Whatever;
  i : Integer;
  i := Random(200);

btw- Barry, I'm still curious and don't know how to make those stars... Did you have time to send the floopies???


Author Comment

ID: 1344189
Hello Viktor

I should put it every time I'm using Random function. Why ?
Why don't I just put it once, for example in formcreate or formshow.
LVL 10

Expert Comment

ID: 1344190
Because the Randomize function simply randomizes the seed of the real random number..thus if you want to have a completely different number in somewhere youshould do that... Possibly in each of the functions where you use Random()...


Featured Post

Technology Partners: 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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month9 days, 2 hours left to enroll

764 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