GUI

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"
	Next
End Function
Subscribe to RSS - GUI