old code

Build a List of Hours (Classic ASP)

You could need a list of "Hours" for any number of reasons, for a select box, checkboxes, radio buttons, etc. In the following example, I create a list of "Hours" to run along the top of a table. What strikes me interesting about this code is that although it was written in 2001, its very adaptable to generating hour lists today.

Function BuildHourList()
	Dim i, iOffSet
	For i = 8 to 20
		' ---- if past 12 noon, 
		If i > 12 Then iOffSet = -12 
		Response.Write "" & iOffset + i & ":00"
End Function

The Beauty of a Complicated Function Comment Header (Classic ASP)

Without boring you with details, I wrote an application back in 2003 for a medical billing company. Their team was extremely small, so when I left the project, I made sure they had some very clear documentation. The function headers were my favorites. Here's an example.

Well written comments that are clear and easy to read is very important to code maintenance and reducing technical debt incurred as old applications lose their orriginal developers.


Formatting Hours and Minutes (Classic ASP)

And another old code segment, this time formatting "Hours" and "Minutes". The trick for the minutes is to return one of the quarter hours. If the minutes evaluate to "0", then "00" will return instead.


Searching a Very Long String - Efficiently (Classic ASP)

When it comes to string handling, ASP isn't the most efficient. The easiest code to write is simply instr(1,ucase(search),ucase(find)), and then check the result for > 0. The problem comes with extremely long strings. I needed to search a very long string of values from each line of CSV. It was actually much faster to split each line into its individual elements and search one cell at a time. Here is the code.

Removing Tag Attributes from HTML - Classic ASP

When parsing a string of HTML to enterrogate for data, sometimes the HTML attributes would create unneeded headaches. I wrote this function to take a string of HTML and remove all tag attributes.


Parsing HTML Text - Removing Unneeded Tags (More Classic ASP)

This little function was a nifty way to remove unneeded HTML tags from a string. Used this to clean up "screenscrapes" of reports generated in HTML before parsing the content.


Convert HTML table into ASP Array

At some point, I was parsing HTML text and needed to convert a table to an Array. The code basically strips any attributes, then cycles through all of the cells and returns an array. I used this code when converting reports from another system (that emitted HTML) to be used in data aggregation functions.

Subscribe to RSS - old code

Fatal error: Class CToolsCssCache contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (DrupalCacheInterface::__construct) in /home/content/e/x/t/ext237/html/modules/ctools/includes/css-cache.inc on line 52