Click here to Skip to main content
15,887,596 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralMake the font red! No, black! Can we do both? Pin
AnalogNerd20-Dec-12 8:51
AnalogNerd20-Dec-12 8:51 
GeneralRe: Make the font red! No, black! Can we do both? Pin
Rob Grainger20-Dec-12 9:21
Rob Grainger20-Dec-12 9:21 
GeneralRe: Make the font red! No, black! Can we do both? Pin
Brisingr Aerowing20-Dec-12 11:23
professionalBrisingr Aerowing20-Dec-12 11:23 
GeneralRe: Make the font red! No, black! Can we do both? Pin
onelopez26-Dec-12 18:21
onelopez26-Dec-12 18:21 
GeneralRe: Make the font red! No, black! Can we do both? Pin
fjdiewornncalwe27-Dec-12 6:23
professionalfjdiewornncalwe27-Dec-12 6:23 
GeneralRe: Make the font red! No, black! Can we do both? Pin
Brisingr Aerowing30-Dec-12 12:08
professionalBrisingr Aerowing30-Dec-12 12:08 
GeneralRe: Make the font red! No, black! Can we do both? Pin
Rob Grainger4-Jan-13 9:58
Rob Grainger4-Jan-13 9:58 
GeneralVal Grind (the wrong kind) Pin
Rob Grainger20-Dec-12 5:12
Rob Grainger20-Dec-12 5:12 
From some legacy VB6 code I'm in the process of making redundant...

VB
Private Sub Command7_Click()
    Dim PolNumb As Long

    If Val("" & txtOpenPolicyNo) > 0 Then
        PolNumb = Val("" & txtOpenPolicyNo)
    Else
        PolNumb = Val("" & InputBox("Policy ID "))
        If Val("" & PolNumb) > 0 Then
           PolNumb = GetPolicyNumberfromID(PolNumb)
        End If
    End If

    If Val("" & PolNumb) > 0 Then
        FindPolicy GetPolicyIDfromNumber(PolNumb)
    End If
End Sub


I particularly like the lines...

If Val("" & PolNumb) > 0 Then


which effectively convert a number to a string, prepend an empty string, then convert it back again... just for good measure.
GeneralRe: Val Grind (the wrong kind) Pin
Sander Rossel20-Dec-12 10:40
professionalSander Rossel20-Dec-12 10:40 
GeneralRe: Val Grind (the wrong kind) Pin
Nagy Vilmos20-Dec-12 22:55
professionalNagy Vilmos20-Dec-12 22:55 
GeneralRe: Val Grind (the wrong kind) Pin
Brady Kelly2-Jan-13 21:46
Brady Kelly2-Jan-13 21:46 
GeneralRe: Val Grind (the wrong kind) Pin
Nagy Vilmos2-Jan-13 22:52
professionalNagy Vilmos2-Jan-13 22:52 
GeneralRe: Val Grind (the wrong kind) Pin
LesF4-Jan-13 9:51
LesF4-Jan-13 9:51 
GeneralRe: Val Grind (the wrong kind) Pin
Rob Grainger4-Jan-13 10:09
Rob Grainger4-Jan-13 10:09 
GeneralRe: Val Grind (the wrong kind) Pin
Sander Rossel4-Jan-13 11:56
professionalSander Rossel4-Jan-13 11:56 
GeneralRe: Val Grind (the wrong kind) Pin
Member 46088986-Jan-13 11:45
Member 46088986-Jan-13 11:45 
GeneralRe: Val Grind (the wrong kind) Pin
Sander Rossel6-Jan-13 12:26
professionalSander Rossel6-Jan-13 12:26 
GeneralRe: Val Grind (the wrong kind) Pin
Chris Quinn24-Dec-12 0:19
Chris Quinn24-Dec-12 0:19 
GeneralRe: Val Grind (the wrong kind) Pin
Rob Grainger29-Dec-12 3:19
Rob Grainger29-Dec-12 3:19 
GeneralRe: Val Grind (the wrong kind) Pin
Chris Quinn31-Dec-12 0:17
Chris Quinn31-Dec-12 0:17 
GeneralRe: Val Grind (the wrong kind) Pin
Rob Grainger31-Dec-12 2:57
Rob Grainger31-Dec-12 2:57 
AnswerRe: Val Grind (the wrong kind) Pin
Mark Hurd3-Jan-13 14:32
Mark Hurd3-Jan-13 14:32 
GeneralRe: Val Grind (the wrong kind) Pin
Rob Grainger4-Jan-13 9:55
Rob Grainger4-Jan-13 9:55 
GeneralRe: Val Grind (the wrong kind) Pin
Mark Hurd4-Jan-13 14:56
Mark Hurd4-Jan-13 14:56 
GeneralRe: Val Grind (the wrong kind) Pin
playstation328-Dec-12 21:22
playstation328-Dec-12 21:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.