Results 1 to 8 of 8

Thread: Showing all in between...

  1. #1

    Thread Starter
    Addicted Member Dementia Freaks's Avatar
    Join Date
    Jun 2001
    Location
    Canada
    Posts
    132

    Showing all in between...

    As a part of an app im making, I would like there to be a part that generates numbers. Not randomly, but in text1 they put in the starting number, and in text 2 they put in a finishing number, and hit generate (command1). how could i do this?
    oh yeah, i would like all the numbers to show up in text3. BUT on seperate lines! ie:

    Start #: 1 End #: 20

    |_____Generate_____|

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

    See, just like that. I have been funbling with this one for a while. Its a small portion, but I cant finish without it. any help would be greatly appreciated!
    Gray FOX: "Only a fool, trusts his life to a Weapon!"

    Bart Simpson: "Bart no like! Baaad medicene!"

    www.sling.to/dementia-freaks <<<---Goto my site!

    http://pub80.ezboard.com/bdementiafreaksforum <<<---Goto my forum!

    Thats it!

  2. #2
    VB Code:
    1. For i = Val(txtStart.Text) To Val(txtEnd.Text)
    2.     txtNumbers.Text = txtNumbers.Text & i & vbCrLf
    3. Next i
    4. txtNumbers.Text = Left$(txtNumbers.Text, txtNumbers.Text - 1)

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim i As Integer
    3.     Dim s As String
    4.     For i = Val(Text1.Text) To Val(Text2.Text)
    5.         s = s & i & vbCrLf
    6.     Next i
    7.     Text3.Text = s
    8. End Sub
    -= a peet post =-

  4. #4
    Jeez, again peet has to nuke a thread!

  5. #5

    Thread Starter
    Addicted Member Dementia Freaks's Avatar
    Join Date
    Jun 2001
    Location
    Canada
    Posts
    132
    those work, but peets overflows at 6 numbers. it to handle 11 numbers. MAX.
    Gray FOX: "Only a fool, trusts his life to a Weapon!"

    Bart Simpson: "Bart no like! Baaad medicene!"

    www.sling.to/dementia-freaks <<<---Goto my site!

    http://pub80.ezboard.com/bdementiafreaksforum <<<---Goto my forum!

    Thats it!

  6. #6
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    oh.. sorry filburt... and u actually posted some code ?? Shame on me !
    -= a peet post =-

  7. #7
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Originally posted by Dementia Freaks
    those work, but peets overflows at 6 numbers.
    Hmmm Are u sure? Apart from wording I cant see any diff betw Peet's code and the turtle (except the subtraction of the vbcrlf)
    Regards
    Stuart
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  8. #8
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    -= a peet post =-

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