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

    Join Date
    Mar 2003
    Posts
    2,715
    Rep Power
    25

    trim var problems...my brain has left me


    Ok... I cant for the life of me think of how to set this up

    <a href="<%=subNavUrl%>" class="subNavLink"><%=LCASE( Replace( pageTitle, "_", " " ) )%></a>&nbsp;:

    so that the &nbsp;: is not display at the end of the last item in the list. My links are called from a sub, but thats not relevant to this question. A link is as follows:

    <%WriteSubNav "/home/home.asp", "newsfeeds", "view our newsfeeds from around the world"%>

    any help appreciated.
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Canada - Egypt
    Posts
    60
    Rep Power
    12
    passing a boolean parameter to define if the : should be written or not seems like a simple solution.

    If there is no way for you to find out when is the call going to be the last one, you could reverse it, so you would only have to worry about finding out when is the call going to be for the first one,

    instead of writing
    <a>...</a> :
    make it write
    :<a>...</a>
    except for the first one where you write
    <a>....</a>


    I hope this is of any help.
    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
    putting it in front of the first one would be much easier as I cant really determine how many there are using the string I have at the moment.

    How do I determine the first.

    <% if num >1 the
    :
    else

    end if
    %>

    does not work as obviously there is no num var...
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

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

    Create One


    At the begining of the page create a variable ..

    probably boolean ...

    set it to False

    and when you are writing the link check if the variable is true or false ..

    if it is true, write the : at the begining

    if it is false don't write the :


    and after the write, set the variable to true, so the very first write will find the variable false and the rest will find it true.


    I hope this is of nay help.
    I hope this is of any help to anyone.

    Yassoor
    http://www.WebsitesCreation.ca

IMN logo majestic logo threadwatch logo seochat tools logo