Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
How to loop through all possible ASCII characters
I am curious as to how I can loop through all possible words, basically.
I can do something like this:
Make an array of characters of A - Z ASCII(65 - 90)
For ii = 65 To 90
j = j + 1
Char(j) = Chr$(ii)
But I can only hard-code for a given length of characters:
For i = 1 to 26
For i2 = 1 to 26
For i3 = 1 to 26
strGeneratedWord = Char(i) & Char(i2) & Char(i3)...
The problem with the above code is that it will only loop for a given
number of characters, and only that amount, but you have to hard-code
an extra for-loop or take one away to increase/decrease.
There must be an easier way.
Let's say I wanted to loop through all possible phone numbers...all
I would have to do is just say i = 0 to 9999 and all numbers between
would be every possible 4-digit number.
So let's say I wanted to see every 1 through 10 character word possible:
A To ZZZZZZZZZZ
This is boggling my mind.