4
Contributors
6
Replies
18
Views
4 Years
Discussion Span
Last Post by rishif2
0

Please explain in more detail what you want to do because I really don't understand what your saying

0

If you are reading the characters in a string then

    Dim aChr as String
    Dim X as Integer

    For X = 1 to len(MyString)
            aChr = mid$(MyString,1 ,1)
            'do code
    Next X

If you are reading from a file that will be different.

0

len function is not working...
its considering it as an array...

thank you......

0

make it
mid$(achr, X, 1)
that should work better

Edited by Klahr_R

0

sir problem is not with mid$
but with len(string)

when i write like that, it shows an error that len not delared

0

@Klahr_R
Never Forget to increment the value of X. in you case it will always return the same character because start position is not incremented. so don't forget to put X=X+1 after mid$(achr, X, 1)

@baabjitvk
try this

Dim str As String
Dim i As Integer
i = 1
str = "String"
While i <= Len(str)
MsgBox Mid(str, i, 1)
i = i + 1
Wend

hope this helps you . . .

Edited by rishif2

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.