Click to See Complete Forum and Search --> : Why does this code take up so much memory?


Geoff Fink
August 12th, 1999, 01:20 PM
Why does the following code take up so much memory? It runs my computer, PII 400, 124 megs. sdram, 17 gig har drive with about 5 full, out of memory?
Randomize

p1 = Int((8 * Rnd) + 1)
1
p2 = Int((52 * Rnd) + 1)
If p1 = p2 Then GoTo 1
2
p3 = Int((52 * Rnd) + 1)
If p3 = p1 Then GoTo 2
If p3 = p2 Then GoTo 2
3
p4 = Int((52 * Rnd) + 1)
If p4 = p1 Then GoTo 3
If p4 = p2 Then GoTo 3
If p4 = p3 Then GoTo 3
4
p5 = Int((52 * Rnd) + 1)
If p5 = p1 Then GoTo 4
If p5 = p2 Then GoTo 4
If p5 = p3 Then GoTo 4
If p5 = p4 Then GoTo 4


How does the random statment work?
Geoff

August 12th, 1999, 01:25 PM
Methinks once you expend a little effort and look up the answer to the second question, the first will be resolved as well.