|
-
Sep 19th, 2000, 05:44 PM
#1
Thread Starter
Lively Member
what is the quickest way to list 10 numbers from >.
Thanks
-
Sep 19th, 2000, 05:49 PM
#2
Fanatic Member
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
Is that what you mean???? (I'm confused by the > sign)
-
Sep 19th, 2000, 06:24 PM
#3
Thread Starter
Lively Member
How can i list list 10 numbers from Bigest to Smallest
-
Sep 19th, 2000, 06:31 PM
#4
Code:
Dim i As Integer
For i = 10 To 0 Step -1
Print i
Next i
-
Sep 19th, 2000, 06:35 PM
#5
_______
<?>
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
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 19th, 2000, 06:37 PM
#6
Thread Starter
Lively Member
ha ha denniswrenn
Is this the shortest it gets HeSaidJoe?
[Edited by BIacksun on 09-19-2000 at 07:40 PM]
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
|