Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 2nd, 2003, 12:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default Rows/Line Counter

How do I know what line or row I am printing on? I need to show data from a table in two columns, 26 rows. Please let me know how to go about coding this display layout.

Thanks,
Judy Sese
 
Old July 2nd, 2003, 05:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

Why not just use a counter variable and increment it as you move down the table at the end of each row ?
 
Old July 3rd, 2003, 10:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default

I am sorry I was not clear on my question. I guess what I am trying to as is the syntax or code to start printing on the first line of the 2nd column.

This is the scenario:

Records 1 -26 should be displayed/printed in column 1. Records 27 - 52 needs to be printed in column 2. I used a <table> to display columns 1 and 2. My problem is column 2 is displaying below column 1. I need it to be displayed beside colum 1.

Which brings me back to my question, how to display records in two colums. That is why I was asking about line number so I can store the first records line counter and when record 27 is read I can tell it to go to column 2 same line counter as record 1. I do not know how to go about this problem. If someone can help me please.

Thanks
 
Old July 3rd, 2003, 10:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

You can use recordset's GetRows in order to get all records at once. Then you can process all records in the matrix variable...
Code:
mat=rs.GetRows
' if you have more columns than you can calculate columns number
'm=UBound(mat,1)+1
'and rows number
'n=UBound(mat,2)+1
;In you case n=52
n=52

Response.Write "<table>"
For i=0 to n/2-1 
    Response.Write "<tr><td>"  &  mat(0,i) & "</td>"
    Response.Write "<td>"  &   mat(0,i+26) & "</td></tr>"
Next
Response.Write "</table>"
...but the Soon is eclipsed by the Moon
 
Old July 4th, 2003, 04:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

LOL, I just posted pretty much the same solution to this problem in the ASP Databases forum. Hey, NotNowJohn, do you think its a case of "great minds think alike", or is it "fools seldom differ"?
;)
Quote:
quote:Originally posted by NotNowJohn
 You can use recordset's GetRows in order to get all records at once. ..
 
Old July 4th, 2003, 11:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Hehe
Sometimes I am glad to see that someone else use the same way, but sometimes I enjoy in the discussions about the solution's road.:)
Next time when I see that your name is under the last poster’s name of the forum, I will skip it.:)
In these forums there is appreciably possibility for "duplicate answers" cause a lot of users post their questions in several forums, sometimes under the different captions.


Regards,
NNJ


...but the Soon is eclipsed by the Moon





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to draw indicator line in owc line chart AlexOo General .NET 0 July 9th, 2007 10:32 PM
Reading a string from line by line vaidyapragati ASP.NET 2.0 Professional 1 May 3rd, 2007 08:43 AM
How to read file line by line in EVC++ iriskab Visual C++ 0 September 27th, 2006 01:39 PM
Reading line by line from a .txt file x_ray VB.NET 2002/2003 Basics 5 February 10th, 2006 01:55 PM
Limit rows returned and next rows minhpx General .NET 1 August 12th, 2004 06:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.