Results 1 to 14 of 14

Thread: [RESOLVED] Generating Numbers..

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Posts
    157

    Resolved [RESOLVED] Generating Numbers..

    Hmm, not sure how to put this really.. I wanna know if it's possible to generate a WHOLE list of the possible combinations you can make using 0-9.. An I want it to remove doubles if there are any.. Is there ANYWAY at all this coule be done?

  2. #2
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: Generating Numbers..

    for sure you can, how many digits you want
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Posts
    157

    Re: Generating Numbers..

    Oops, sorry I thought I posted how many I wanted. I wanna generate every possible 8 digit number using 0-9.. Thanks .

  4. #4
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: Generating Numbers..

    sure you can, use a nested loop to do that
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Posts
    157

    Re: Generating Numbers..

    Erm, explain? :\

  6. #6
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Generating Numbers..

    Where are you going to store 100 million numbers?
    VB Code:
    1. Dim i as Long
    2. For i = 0 to 99999999
    3.    '..
    4. Next

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Posts
    157

    Re: Generating Numbers..

    Quote Originally Posted by jcis
    Where are you going to store 100 million numbers?
    VB Code:
    1. Dim i as Long
    2. For i = 0 to 99999999
    3.    '..
    4. Next


    See, I tried that once before I posted here.. I tried everything.. I don't need it to start at 0 I need it to start at 00000000 and end at 99999999... Every digit has to be 8 digits long..

  8. #8
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Generating Numbers..

    VB Code:
    1. Dim i As Long
    2.     For i = 0 To 99999999
    3.         MsgBox Format$(i, "00000000")
    4.     Next

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Posts
    157

    Re: Generating Numbers..

    Heh.. Anyway at all to make VB not freeze for this?

  10. #10
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Generating Numbers..

    try adding a DoEvents inside the loop, and what are you doing with that values? That's why I asked if you're storing them somewhere or what, the MsgBox is just an example it shouldn't be there.

  11. #11
    Fanatic Member damasterjo's Avatar
    Join Date
    Nov 2005
    Location
    In front of my Comp DirectX7 EXpert
    Posts
    827

    Re: Generating Numbers..

    try
    VB Code:
    1. do while i< 99999999
    2. doevents
    3.     Dim i As Long
    4.     For i = 0 To 99999999
    5.         MsgBox Format$(i, "00000000")
    6.     Next
    7. loop
    Software languages known:
    Qbasic - TI-Basic - Liberty Basic - Visual Basic 6
    Software API's known:
    Directx 7 and 8
    Internet languages, in the process of learning:
    HTML - JAVASCRIPT - PHP - CSS - MYSQL - AJAX

  12. #12
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Generating Numbers..

    Quote Originally Posted by damasterjo
    try
    VB Code:
    1. do while i< 99999999
    2. doevents
    3.     Dim i As Long
    4.     For i = 0 To 99999999
    5.         MsgBox Format$(i, "00000000")
    6.     Next
    7. loop
    Why you added another loop if you already have one?

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Posts
    157

    Re: Generating Numbers..

    Quote Originally Posted by damasterjo
    try
    VB Code:
    1. do while i< 99999999
    2. doevents
    3.     Dim i As Long
    4.     For i = 0 To 99999999
    5.         MsgBox Format$(i, "00000000")
    6.     Next
    7. loop
    Quote Originally Posted by jcis
    Why you added another loop if you already have one?
    Yea, he is right. the

    Code:
    do while i < 99999999
    'blah blah
    loop
    Still made it freeze so I took that out and added the doevents into the for loop and it works fine. Thanks both of you guys..

  14. #14
    Fanatic Member damasterjo's Avatar
    Join Date
    Nov 2005
    Location
    In front of my Comp DirectX7 EXpert
    Posts
    827

    Re: Generating Numbers..

    Quote Originally Posted by jcis
    Why you added another loop if you already have one?
    well that will make it loop through everything in the loop, if there was more than one thing, and prevent it from locking up. I learned that early on when programming my game..
    Software languages known:
    Qbasic - TI-Basic - Liberty Basic - Visual Basic 6
    Software API's known:
    Directx 7 and 8
    Internet languages, in the process of learning:
    HTML - JAVASCRIPT - PHP - CSS - MYSQL - AJAX

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