|
-
Nov 26th, 2000, 10:44 PM
#1
Thread Starter
New Member
I'm really lost on the selection sort part of my project. My problem is with the sort. I got this form earlier:
for c = 1 to 10
for n = 0 to 8
If Val(a(n))>Val(a(n+1))
b = 0
b = a(n)
a(n) = Val(a(n+1))
a(n+1) = b
end if
next n
next c
What does val and b represent? Is b like temp? Now I know C is the 10 random numbers, a is the arrayname, and n is the array index(I think).
This is what I have for that part:
Private Sub cmdLoadArray_Click()
For i = 1 To 10
RandomNumber = Int(100 * Rnd) + 1
txtOriginal.Text = txtOriginal.Text & " " & RandomNumber
Next i
End Sub
So would A be txtOriginal.text and C be RandomNumber? Also since there are 6 spaces between the random numbers, would the first number that comes up be on index 6?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|