Solved

Randomize

Posted on 1998-10-24
4
340 Views
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.

Regards,
Joely
0
Comment
Question by:joely
[X]
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
4 Comments
 
LVL 17

Expert Comment

by:inthe
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 ¤¤¤¤¤¤¤
0
 
LVL 10

Accepted Solution

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

procedure Whatever;
var
  i : Integer;
begin
  Randomize;
  i := Random(200);
end;

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

Cheers,
Viktor
0
 

Author Comment

by:joely
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.
0
 
LVL 10

Expert Comment

by:viktornet
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()...

Cheers,
Viktor
0

Featured Post

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!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

696 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