ASP 101 - Active Server Pages 101
The Place ASP Developers Go!

Please visit our partners

Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
Developer
International
Internet Lists
Internet News
Internet Resources
IT
Linux/Open Source
Personal Technology
Small Business
Windows Technology
xSP Resources
Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash
your e-mail address:



 Top ASP 101 Stories Top ASP 101 Stories
VBScript Classes: Part 1 of N
Migrating to ASP.NET
Getting Scripts to Run on a Schedule

QUICK TIP:
Make Your Site's RSS Feed Shine
Show All Tips >>


ASP Developing for Academic and Business Processes
Utilizing ASP in Systems Development
Case: Develop a Research Library Website from Scanned Input

Next is the heart of the loop for data, when the line count gets to 41, it inserts the coding to begin a new column or falls into the standard loop and outputs a line. It also adds the topic to the meta tags list on the way through the loop. As with most coding, the end conditions are what take all the work. Each field is trimmed as it's used, and the string is output. For dynamic content creating a table won't allow the client to see anything until the table is closed, but here it's being used for file creation so is not important.

if paging = 41 then
    output.writeline("</td><td>")
  else
    if trim(rsInput.Fields("topic")) <> "" then
      metatopics = metatopics & trim(rsInput.Fields("topic")) & ";"
    end if
  aline = trim(rsInput.Fields("topic")) & "  " & trim(rsInput.Fields("subtopic")) & "  "
  if trim(rsInput.Fields("pages")) <> "" then
  aline = aline & "-- " & trim(rsInput.Fields("pages")) & "<br>"
  else
  aline = aline & "<br>"
  end if
  output.writeline(aline)
  aline = ""
end if
rsInput.movenext

And then finishing the page after it runs out of input...

if rsInput.EOF then
  paging = 81
    output.writeline("</td></tr></table>")
    output.writeline("<p><center><table cellpadding=4 cellspacing=2 width='10%'><tr><td align=center bgcolor=silver><a href='" & htmlPrev & "'><font face='Comic Sans MS' size='4'>Previous</font></a></td><td align=center bgcolor=silver><a href='csfa_001.html'><font face='Comic Sans MS' size='4'>Start</font></a></td>")
    output.writeline("</tr></table></center><p>")
    output.writeline("<font size=1>Dynamic Content Resources by<br><a href='http://www.mallard-design.com/'>Mallard Design Company</a></font>")
    output.writeline("</body>")
    output.writeline("</html>")
    output.close
end if

next

At this point, the page is full and the meta tag list is ready to output to a file for adding to the page on the second pass. The was a conscious choice, in other cases it would be better to store the page and add the list as final output. In this case a lot of the entries have commas, which need replacement before the topic can be used as a meta tag keyword. It's simpler here to open the finished file and globally change the entries into meta tag format and then paste them into the page.


Stuff
Previous versions of VBScript are CaseSensitive, this is written for the latest version.
Development Test System: Windows98, PentiumII 200MHz 128Mb
Personal Web Server 4.0 (IIS4), SQL7b3, Personal Oracle, Sybase

Author: T.Mallard, Seattle, WA
http://www.mallard-design.com/
Copyright 1999 Thomas Mallard, USA

 


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback


JupiterWeb networks:

internet.comearthweb.comDevx.com graphics.com

Search JupiterWeb:

Jupitermedia Corporation has two divisions: Jupiterimages andJupiterWeb

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers