|
-
Mar 29th, 2006, 10:30 PM
#1
Thread Starter
Addicted Member
[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?
-
Mar 29th, 2006, 10:36 PM
#2
Frenzied Member
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
-
Mar 29th, 2006, 10:40 PM
#3
Thread Starter
Addicted Member
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 .
-
Mar 29th, 2006, 11:00 PM
#4
Frenzied Member
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
-
Mar 29th, 2006, 11:09 PM
#5
Thread Starter
Addicted Member
-
Mar 29th, 2006, 11:22 PM
#6
Re: Generating Numbers..
Where are you going to store 100 million numbers?
VB Code:
Dim i as Long
For i = 0 to 99999999
'..
Next
-
Mar 29th, 2006, 11:29 PM
#7
Thread Starter
Addicted Member
Re: Generating Numbers..
 Originally Posted by jcis
Where are you going to store 100 million numbers?
VB Code:
Dim i as Long
For i = 0 to 99999999
'..
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..
-
Mar 29th, 2006, 11:33 PM
#8
Re: Generating Numbers..
VB Code:
Dim i As Long
For i = 0 To 99999999
MsgBox Format$(i, "00000000")
Next
-
Mar 29th, 2006, 11:37 PM
#9
Thread Starter
Addicted Member
Re: Generating Numbers..
Heh.. Anyway at all to make VB not freeze for this?
-
Mar 29th, 2006, 11:39 PM
#10
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.
-
Mar 29th, 2006, 11:41 PM
#11
Fanatic Member
Re: Generating Numbers..
try
VB Code:
do while i< 99999999
doevents
Dim i As Long
For i = 0 To 99999999
MsgBox Format$(i, "00000000")
Next
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
-
Mar 29th, 2006, 11:43 PM
#12
Re: Generating Numbers..
 Originally Posted by damasterjo
try
VB Code:
do while i< 99999999
doevents
Dim i As Long
For i = 0 To 99999999
MsgBox Format$(i, "00000000")
Next
loop
Why you added another loop if you already have one?
-
Mar 29th, 2006, 11:50 PM
#13
Thread Starter
Addicted Member
Re: Generating Numbers..
 Originally Posted by damasterjo
try
VB Code:
do while i< 99999999
doevents
Dim i As Long
For i = 0 To 99999999
MsgBox Format$(i, "00000000")
Next
loop
 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..
-
Mar 31st, 2006, 04:36 PM
#14
Fanatic Member
Re: Generating Numbers..
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|