For Statments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BarryM
    New Member
    • Mar 2008
    • 32

    For Statments

    Im havin troubles with a for statement

    here is how i have done it

    dim len as string = fd.text.length - 1
    dim i as integer = 0

    for i = len to 0
    if fd.text.chars(i ) = "\" then
    msgbox("\ found")
    end if
    next

    this comes up with no errors but doesent work
  • mafaisal
    New Member
    • Sep 2007
    • 142

    #2
    Hello
    Try This

    Code:
    dim len as integer 
    len= fd.text.length - 1
    dim i as integer
    for i = len to 0 step -1
    if fd.text.chars(i) = "\" then
    msgbox("\ found")
    end if
    next
    Notes In your code len declare as string changes to integer
    also changes in for loop

    Faisal

    Comment

    • BarryM
      New Member
      • Mar 2008
      • 32

      #3
      thanks works like a charm

      Comment

      Working...