Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004
    Posts
    133

    Unanswered: count the total number of characters inside word

    Hi all
    I'm stuck with this:
    How can I count the total number of characters that appear inside a word?
    Let say that I have a "Hello" word
    How do I know that this word have 5 characters and it will
    be displayed in Immidiete window as follow:
    H
    e
    l
    l
    o
    Could you give me this code?
    Many thanks.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    You can use the LEN function to get the number of chars. Include TRIM() if you think there may be trailing or leading spaces. Access help has all the dets.

    You will have to expand about your other requirement - why do you need to print one letter at a time to the immediate window?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Code:
    dim iptr as integer, iStrLength as integer
    mystrval=trim(mystrval)
    istrlength=len(mystrval)
    for iptr=1 to istrlength
      debug.print(mid$(mystrval,iptr,1)
    next iptr
    its air code, so it probably won't compile first time, the pointers may need tobe zero based for mid$

    the help system should put you right on most of the (potential) problems
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    May 2004
    Posts
    133
    Thank you. It helped me

Posting Permissions

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