I.T. Discussion Community!
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE

Prestwood eMagazine

September Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyPascal and Delphi Coding BoardDelphi News / Other Topic   Print This     

Needing Help With Random Numbers

Needing Help With Random Numbers in Delphi News / Other topic (part of our Pascal and Delphi Coding group).

Quick Search: Needing   Numbers   Needing Random   Needing Random Numbers  
LocVez
Scotland, UK
i have written a little bit of code that's suppsoed to generate random numbers, turn em into a string and put the value into a string variable.

Works fine in practice.....but it doesn't generate the numbers randomly, every time i run my programme it generates the exact same numbers :-/


here is a copy of my code, any help is greatly appreciated

 procedure intro;
begin
repeat
rnumber:= 1+random(4); //sets rnumber equal to the values 1 to 4
moves := IntToStr(rnumber); //turns the number into a string and palces the string into moves
for count := 1 to length(moves) do
begin
delay(700); //sets the delay to 700 milliseconds
flashtile; //calls procedure "flashtile"
delay(700); //sets the delay to 700 milliseconds
resettile; //calls function "resettile"
end;//for count :=1 to length(moves) do
until loopcount=0;
end;
 Posted 14 years ago (Thread Starter)
Comment Quote
About LocVez -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #11333, 1 replies
Thread Started 10/22/2005 9:04:00 AM
View Counter=3522
Last Reply Posted 10/26/2005 7:35:00 AM)
Location=Scotland, UK  
Joined=14 years ago   MB Posts=1  
Most Recent Post
Deleted Member
Have you tried calling the Randomize procedure to initialize the generator before entering this loop?
 Posted 14 years ago
Comment Quote
About deleted_member -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #11338 (Level 1.1)  Reply to 11333
Thread Started 10/26/2005 7:35:00 AM
View Counter=2
Location=-- USA 
Joined=12 years ago   MB Posts=184  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1151A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #11333 Counter
3522
Since 4/2/2008

Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech