Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 02-15-07   #1 (permalink)
Audiophile
 
Mebby's Avatar
 
intel ati

Join Date: Jul 2006
Location: Manchester
Posts: 1,871

Rep: 37 Mebby is acknowledged by some
Unique Rep: 36
Folding Team Rank: 606
Team Name: RatRod
Trader Rating: 0
Default Quick Delphi help V.2

New question.

Use a repeat until loop to generate a random number in the range 1 to 1000, that is not exactly divisible by 3 and store the value in the Tag property of an edit box called edtExample

So would this be right? (I don't really understand the question myself.

Repeat

edtExample.Tag := Random(999) + 1 ;

Until edtExample.Tag Mod 3 = 0 ;
__________________
System: Core Power!
CPU
E6400 @ 3.2Ghz
Motherboard
Maximus Extreme
Memory
2x 1Gb || PC3-8500
Graphics Card
X1950 Pro Crossfire
Hard Drive
80Gb Seagate
Sound Card
Supreme FX II
Power Supply
Seasonic 500W
Case
Armor LCS
CPU cooling
Water Cooled
GPU cooling
Stock
OS
XP Home
Monitor
19" Ace Widescreen

Last edited by Mebby : 02-21-07 at 12:15 PM.
Mebby is offline I fold for Overclock.net   Reply With Quote
Old 02-15-07   #2 (permalink)
Programmer
 
stupid's Avatar
 
amd nvidia

Join Date: Jan 2006
Location: Fahaheel, Kuwait
Posts: 1,239

Rep: 147 stupid is acknowledged by manystupid is acknowledged by many
Unique Rep: 116
FAQs Submitted: 1
Trader Rating: 4
Default

make an array with 3,6,9,12 and 15 in it, then use the RandomFrom function
http://delphi.about.com/library/rtl/blrtlRandomFrom.htm

--------------------

var
Numbers : array of integer;
useThisOne : integer;

SetLength(Numbers,5);
Numbers[0] := 3; Numbers[1] := 6; Numbers[2] := 9;
Numbers[3] := 12; Numbers[4] := 15;

Randomize;
useThisOne := RandomFrom(Numbers);
__________________
"If there is a god, I hope he has a good excuse"
Woody Allen

System: Minazo
CPU
Opteron 1210
Motherboard
Biostar TForce 550 SE
Memory
2x1GB G.Skill DDR2 800
Graphics Card
eVGA 8800GT
Hard Drive
500GB 16MB Buf Samsung
Power Supply
Corsair HX520W Modular
Case
CoolerMaster Centurion 5
CPU cooling
CoolerMaster GeminII & Scythe SFF21Ds
GPU cooling
Accelero S1 & Scythe SFF21D
OS
XP Pro SP2
Monitor
Dual monitors: 22" & 19" Widescreens

Last edited by stupid : 02-15-07 at 08:05 PM.
stupid is offline   Reply With Quote
Old 02-16-07   #3 (permalink)
Audiophile
 
Mebby's Avatar
 
intel ati

Join Date: Jul 2006
Location: Manchester
Posts: 1,871

Rep: 37 Mebby is acknowledged by some
Unique Rep: 36
Folding Team Rank: 606
Team Name: RatRod
Trader Rating: 0
Default

I ended up useing a case statment but that works to I guess.
__________________
System: Core Power!
CPU
E6400 @ 3.2Ghz
Motherboard
Maximus Extreme
Memory
2x 1Gb || PC3-8500
Graphics Card
X1950 Pro Crossfire
Hard Drive
80Gb Seagate
Sound Card
Supreme FX II
Power Supply
Seasonic 500W
Case
Armor LCS
CPU cooling
Water Cooled
GPU cooling
Stock
OS
XP Home
Monitor
19" Ace Widescreen
Mebby is offline I fold for Overclock.net   Reply With Quote
Old 02-22-07   #4 (permalink)
Audiophile
 
Mebby's Avatar
 
intel ati

Join Date: Jul 2006
Location: Manchester
Posts: 1,871

Rep: 37 Mebby is acknowledged by some
Unique Rep: 36
Folding Team Rank: 606
Team Name: RatRod
Trader Rating: 0
Default

Any suggestion on this one?
__________________
System: Core Power!
CPU
E6400 @ 3.2Ghz
Motherboard
Maximus Extreme
Memory
2x 1Gb || PC3-8500
Graphics Card
X1950 Pro Crossfire
Hard Drive
80Gb Seagate
Sound Card
Supreme FX II
Power Supply
Seasonic 500W
Case
Armor LCS
CPU cooling
Water Cooled
GPU cooling
Stock
OS
XP Home
Monitor
19" Ace Widescreen
Mebby is offline I fold for Overclock.net   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 12:51 PM.


Overclock.net is a Carbon Neutral Site Creative Commons License Internet Security By ControlScan

Terms of Service / Forum Rules | Privacy Policy | Advertising | Become an Official Vendor
Copyright © 2008 Shogun Interactive Development. Most rights reserved.
Page generated in 0.28327 seconds with 8 queries