Solved

Classic ASP:  Display item until End Of File

Posted on 2007-04-10
9
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:WMIF
ID: 18885553
that should work just as you have it.
0
 

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Executing a script on a timer online 5 45
Reg Exp to extract Url from string asp 12 61
Building JSON Results Table FROM DB 9 50
VB script help 23 51
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

752 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