WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Increment Through the Alphabet

 Keywords:  

Question:

I'd like to make a For loop that allows me to increment a letter that starts at a and ends as z

Is there a nice algorithm I can use within WinBatch to do this, or would it be easier to make a 2D array to act as a lookup table?

Answer:

You could use:
For xx=1 To 26
    letter=Num2Char(xx+64)
    Pause("Letter",letter)
Next

or

letters="abcdefghijklmnopqrstuvwxyz"
For xx=1 To 26
   letter=StrSub(letters,xx,1)
   Pause("Letter",letter)
Next

Article ID:   W15517
File Created: 2003:05:13:11:28:28
Last Updated: 2003:05:13:11:28:28