in reply to The joys of bad code
This charmer was found in the codebase im working on now. I almost fell out of my chair when I first encountered it:
Public Function MyMonthName(ByVal m As Long, _ Optional ByVal appr As Boolean = False) As + String Dim tmp As String Select Case m Case 1: tmp = "January" Case 2: tmp = "February" Case 3: tmp = "March" Case 4: tmp = "April" Case 5: tmp = "May" Case 6: tmp = "June" Case 7: tmp = "July" Case 8: tmp = "August" Case 9: tmp = "September" Case 10: tmp = "October" Case 11: tmp = "November" Case 12: tmp = "December" Case Else: tmp = Format(m, "0") End Select If appr Then MyMonthName = Left(tmp, 3) Else MyMonthName = tmp End If End Function
First they ignore you, then they laugh at you, then they fight you, then you win.
-- Gandhi
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: The joys of bad code
by bart (Canon) on Oct 26, 2004 at 20:13 UTC | |
|
Re^2: The joys of bad code
by thor (Priest) on Oct 26, 2004 at 15:35 UTC | |
by hardburn (Abbot) on Oct 26, 2004 at 16:41 UTC | |
by demerphq (Chancellor) on Oct 26, 2004 at 17:36 UTC | |
by hardburn (Abbot) on Oct 26, 2004 at 18:30 UTC | |
by Anonymous Monk on Oct 28, 2004 at 00:06 UTC | |
by demerphq (Chancellor) on Oct 28, 2004 at 08:11 UTC | |
| |
by g00n (Hermit) on Oct 28, 2004 at 06:42 UTC | |
by Dylan (Monk) on Oct 26, 2004 at 17:37 UTC | |
by jdporter (Paladin) on Oct 28, 2004 at 17:47 UTC |