what is the quickest way to list 10 numbers from >.
Thanks
Printable View
what is the quickest way to list 10 numbers from >.
Thanks
Is that what you mean???? (I'm confused by the > sign)Code:'//Lists 10 numbers greater than inNum
Dim I As Integer
Dim inNum As Integer
inNum = 5
For I = inNum To inNum + 10
Form1.Print I + 1
Next I
How can i list list 10 numbers from Bigest to Smallest
Code:Dim i As Integer
For i = 10 To 0 Step -1
Print i
Next i
Code:'put them in an array and sort them
Option Explicit
'to sort and array by numeric value
'create a standard project
'on the form add 2 list boxes and a command button
'List1 and List2
'
'this is the code for the command button
'
Sub Command1_Click()
Dim iArray(0 To 9) As Long
Dim iLoop As Integer
Randomize
For iLoop = 0 To 9
iArray(iLoop) = Int(Rnd * 100) + 1
List1.AddItem iArray(iLoop)
Next iLoop
Call BubbleSortNumbers(iArray)
For iLoop = LBound(iArray) To UBound(iArray)
List2.AddItem iArray(iLoop)
Next iLoop
End Sub
'
'add a bas module and put this code in it
'
Sub BubbleSortNumbers(iArray As Variant)
Dim lLoop1 As Long
Dim lLoop2 As Long
Dim lTemp As Long
For lLoop1 = UBound(iArray) To LBound(iArray) Step -1
For lLoop2 = LBound(iArray) + 1 To lLoop1
If iArray(lLoop2 - 1) < iArray(lLoop2) Then
lTemp = iArray(lLoop2 - 1)
iArray(lLoop2 - 1) = iArray(lLoop2)
iArray(lLoop2) = lTemp
End If
Next lLoop2
Next lLoop1
End Sub
ha ha denniswrenn
Is this the shortest it gets HeSaidJoe?
[Edited by BIacksun on 09-19-2000 at 07:40 PM]