Solved

Classic ASP:  Display item until End Of File

Posted on 2007-04-10
9
248 Views
Last Modified: 2008-02-01
Hello.  I am working with Classic ASP (Not .NET) with an MS Access database.

I just need to know the syntax of how to only show something while not at End Of File.

Example:  I only want to show the " | " symbol after each dynamic list link EXCEPT after the last one.

I thought it was something like:
<%IF NOT rsRecordset.Field ("Field name").EOF then%>
Show the symbol
<%END IF%>

Does this look right?

Thanks so much,
Shane
0
Comment
Question by:lshane
  • 5
  • 3
9 Comments
 
LVL 22

Expert Comment

by:WMIF
ID: 18885531
its actually from the recordset itself.  

rsRecordset.eof
0
 

Author Comment

by:lshane
ID: 18885549
So, would it be as simple as:

<%IF NOT rsRecordset.EOF then%>
Show symbol
<%END IF%>

...OR, would I need to add quotes or parentheses or something else in the syntax?

0
 
LVL 22

Expert Comment

by:WMIF
ID: 18885550
eof will only be true once you have moved past the last record.

print - rec 1
rs.movenext
print - rec 2
rs.movenext
print - rec 3
eof = false
rs.movenext
eof = true
0
 
LVL 22

Expert Comment

by:WMIF
ID: 18885553
that should work just as you have it.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:lshane
ID: 18885604
OK - thank you for your help.  I need a little more, though.  I am using DW MX, becaue I'm not proficient enough not to use it.

Here is the link for the site:  <http://www.clutter2treasure.net/antiques_list.asp>
You will see the list of links in the center with the " | " after the last link.  I would like for that NOT to appear after the last link.

So, here is the segment of code for that loop:

------------------------------------------------------------------------------------------------------
While ((Repeat1__numRows <> 0) AND (NOT rsAntiqueList.EOF))
%>
                      <a href="antiques_results.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) & "subcatID=" & rsAntiqueList.Fields.Item("subcatID").Value %>"><%=(rsAntiqueList.Fields.Item("subcatName").Value)%></a>&nbsp;|&nbsp;
                      <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rsAntiqueList.MoveNext()

Wend
%>
------------------------------------------------------------------------------------------------------

What should I do?

Thanks so much,
Shane
0
 
LVL 9

Expert Comment

by:fuzzboxer
ID: 18885784
You may be able to do this without ASP.  You can use the pseudo-selectors :first-child and :before to denote that you want the pipe missing on the first link and printed on the rest.

a:first-child{
/*normal stylings*/
}
a:before{
content:"|"
}

I'll double check the code later, but that might get you started.

0
 
LVL 22

Accepted Solution

by:
WMIF earned 500 total points
ID: 18885990
this should do it for you.  let me know how it comes out.

------------------------------------------------------------------------------------------------------
While ((Repeat1__numRows <> 0) AND (NOT rsAntiqueList.EOF))
%>
                      <a href="antiques_results.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) & "subcatID=" & rsAntiqueList.Fields.Item("subcatID").Value %>"><%=(rsAntiqueList.Fields.Item("subcatName").Value)%></a>
                      <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rsAntiqueList.MoveNext()
     if not rsAntiqueList.eof then
%>
&nbsp;|&nbsp;
<%
     end if
Wend
%>
------------------------------------------------------------------------------------------------------
0
 

Author Comment

by:lshane
ID: 18886372
Thank you, WMIF!  That was perfect!


Thanks so much,
Shane
0
 
LVL 22

Expert Comment

by:WMIF
ID: 18886408
glad to help.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now