#1
  1. meester luva luva
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Posts
    2,715
    Rep Power
    25

    startAt - stopAt problem


    Ok, I am having trouble getting this to do what it should.. which is to set NavID as the directory name from the link... any ideas?

    Sub WriteFooterLink( link, pageTitle, pageDescription )
    startAt = InStrRev ( link, "/" )
    stopAt = InStr( startAt, link, "/" )
    If stopAt = 0 Then
    nav = link
    Else
    nav = Mid( link, startAt, stopAt-startAt )
    End If

    here is the footer link it calls the 'link' from

    <%WriteFooterLink "/home/about_us.asp", "ABOUT US", "about us"%>

    I want it to startAt the first / and stop at the second / so that home as the directory would be the navID
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Canada - Egypt
    Posts
    60
    Rep Power
    12

    InStrRev


    Why is the startAt using InStrRev?! This looks for the last occurrence of / not the first one.
    I hope this is of any help to anyone.

    Yassoor
    http://www.WebsitesCreation.ca
  4. #3
  5. meester luva luva
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Posts
    2,715
    Rep Power
    25
    aye, the penny has now dropped thanks.

IMN logo majestic logo threadwatch logo seochat tools logo