Solved

Classic ASP:  Display item until End Of File

Posted on 2007-04-10
9
252 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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