If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Also, I need to convert letters into numbers in a way that the numbers 1-9 correspond with A-I, J-R, and S-Z (z ending on 8 of course). And I'm hoping there's a short way to program in VB other than A=1 B=2 so on....
Any help is appreciated thanks!

Also, I need to convert letters into numbers in a way that the numbers 1-9 correspond with A-I, J-R, and S-Z (z ending on 8 of course). And I'm hoping there's a short way to program in VB other than A=1 B=2 so on....

Let's assume that you're using a character set where the letters of the English alphabet are contiguous in alphabetical order. You can therefore map the alphabet to an integer from 1 to 26. Next, figure out how you can map the numbers from 1 to 26 to the numbers 1 to 9, according to your desired scheme.

Let's assume that you're using a character set where the letters of the English alphabet are contiguous in alphabetical order. You can therefore map the alphabet to an integer from 1 to 26. Next, figure out how you can map the numbers from 1 to 26 to the numbers 1 to 9, according to your desired scheme.

I get the pattern, can't believe I didn't think of it. For the English alphabet I don't know what you mean by mapping. I'm just learning and not very advanced in programming yet, but I learn quick if you can explain it a little more in depth.

Re: Reducing numbers to one digit (numerology related)

Originally Posted by nlw92

I get the pattern, can't believe I didn't think of it.

Good to hear that.

Originally Posted by nlw92

For the English alphabet I don't know what you mean by mapping.

When you say "I'm hoping there's a short way to program in VB other than A=1 B=2 so on", the "A=1 B=2 so on" is a mapping from the letters to the corresponding numbers. In this case you're using what is called a lookup table, but the "short way to program" involves replacing the lookup table with a mathematical formula.

By the way, numerology usually refers to some system of deriving possibly mystical meaning from numbers, whereas you're looking for something more along the lines of number theory.

Re: Reducing numbers to one digit (numerology related)

Originally Posted by laserlight

Good to hear that.

When you say "I'm hoping there's a short way to program in VB other than A=1 B=2 so on", the "A=1 B=2 so on" is a mapping from the letters to the corresponding numbers. In this case you're using what is called a lookup table, but the "short way to program" involves replacing the lookup table with a mathematical formula.

By the way, numerology usually refers to some system of deriving possibly mystical meaning from numbers, whereas you're looking for something more along the lines of number theory.

It's definitely for numerology, I just didn't fully explain the end goal of the program because I figured the mystical meanings of each number would be irrelevant. I was completely lost when it came to calculating the digital root using code. I think I'm going to use the formula Dr(n)=1+((n-1)mod 9). How do you express mod 9 in Visual basic code?