Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634

    Unanswered: Advance to Next Letter

    Is there a sequencing function for letters? I haven't had a need for this and really haven't done much searching, but I thought I'd see if anyone here had come accross this type of scenerio.

    I have an ID that is a combination of 4 letters and/or numbers. A specific group should have thier IDs in sequence (AAA1, AAA2 or 111A, 111B). Incrementing the number is pretty straight-forward, but I was wondering if there was a function to increment letters (seems like there should be).

  2. #2
    Join Date
    Dec 2004
    Location
    Coon Rapids, Minnesota
    Posts
    41
    I dont believe there is a specific function, but you could use the same number incrementing system whilst utilitzing ASCII codes. The only other difference would be writing a little check to see if it is a Z and what to do in that situation

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you could do it via the ASC & CHR functions
    I think...
    the ASC funtion gives you the ascii number fro the supplied character, where as chr gives your the character represented by the number

    usually its beet er to use the ASC$ & CHR$ varianations


    so to get to AAB1 from AAA9 youd have to examine the 4th character to see if it was 9, then increment the 3rd character

    but you would almost certainly have to roll your own fucntion tohandle the cascading and overflow
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Thanks for the input.

    I figured I'd have to write a little something. I'll probably incorporate the ASC function and check the characters from right to left. At least I'm working with a fixed number of charaters and Uppercase letters only.

Posting Permissions

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