incrementing letters a -- b -- c ...

# Thread: incrementing letters a -- b -- c ...

1. Belal Guest

## incrementing letters a -- b -- c ...

if you&#039;re reading off a database and want to increment the records using letters, how to you write a counter for letters?<BR><BR>

2. Senior Member
Join Date
Dec 1969
Posts
3,921

## Convert to ASCII

&nbsp;<BR> sVar = ASC("a")<BR> response.write sVar

3. Senior Member
Join Date
Dec 1969
Posts
3,921

## Convert to ASCII

&nbsp;<BR> sVar = ASC("a")<BR> response.write sVar

4. Belal Guest

## RE: Convert to ASCII

I&#039;m sorry, I wasn&#039;t clear.<BR><BR>I&#039;m reading records off a database and I want to put them in a list.<BR><BR>I just want to display a letter beside each record :<BR><BR><BR>a) intro<BR>b) middle<BR>c) end

5. Senior Member
Join Date
Dec 1969
Posts
1,546

## RE: Convert to ASCII

after results are displayed, run a replace function on that column. (in the table or whatever)<BR>lot&#039;s of writing to do.<BR><BR>replace 1 with A and so on.....sheesh.<BR>I can&#039;t think of another way to do it!<BR>:-)

6. Belal Guest

## RE: Convert to ASCII

Oh, that will take forever,<BR><BR>I&#039;ll try to see another way<BR>

7. Senior Member
Join Date
Dec 1969
Posts
1,546

## uh, yeah

and what are you going to do after the 26th char record? start spewing off numbers? take a looksy lou at your logic first.

8. Senior Member
Join Date
Dec 1969
Posts
1,546

## PLUS

if your response is, "I don&#039;t have that many records" then start writing the replace function, because you know it can&#039;t get worse that 26 times!

9. Senior Member
Join Date
Dec 1969
Posts
293

## RE: Convert to ASCII

The following will do all capital letters. For lower case, check out the ascii codes for lower case...<BR><BR>Or just run lcase(chr(letter))...<BR><BR>For letter = 65 to 90<BR>%&#062;<BR>&#060;%=chr(letter)%&#062;) &#060;%=ADORS("columnName")%&#062;&lt;br&gt;<BR>&# 060;%<BR>Next<BR><BR>But this doesn&#039;t address the "What happens above 26 records returned" problem..it will do 26 records with a letter next to it.<BR>

10. Senior Member
Join Date
Dec 1969
Posts
717

## RE: PLUS

Have you thought about converting all your letters into binary and then writing an Assembly function to calculate the next in the list?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•