Results 1 to 6 of 6

Thread: stuff

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    113
    what is the quickest way to list 10 numbers from >.
    Thanks

  2. #2
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523
    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)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    113
    How can i list list 10 numbers from Bigest to Smallest

  4. #4
    Guest
    Code:
    Dim i As Integer
    For i = 10 To 0 Step -1
        Print i
    Next i

  5. #5
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    113
    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
  •  



Click Here to Expand Forum to Full Width