Click here to Skip to main content

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, embarrasing 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.

 
GeneralRe: Message Other user using CodeProject PinmemberSuvabrata Roy27-Dec-12 23:13 
GeneralRe: Message Other user using CodeProject PinmvpOriginalGriff27-Dec-12 23:23 
GeneralRe: Message Other user using CodeProject PinmemberSuvabrata Roy28-Dec-12 0:22 
GeneralRe: Message Other user using CodeProject PinmemberJan Steyn9-Jan-13 22:48 
GeneralRe: Message Other user using CodeProject PinmvpOriginalGriff9-Jan-13 23:06 
GeneralRe: Message Other user using CodeProject PinmemberProgramFOX26-Dec-12 4:46 
GeneralMake the font red! No, black! Can we do both? PinmemberAnalogNerd20-Dec-12 9:51 
GeneralRe: Make the font red! No, black! Can we do both? PinmemberRob Grainger20-Dec-12 10:21 
GeneralRe: Make the font red! No, black! Can we do both? PinmemberZac Greve20-Dec-12 12:23 
GeneralRe: Make the font red! No, black! Can we do both? Pinmemberjlopez78826-Dec-12 19:21 
GeneralRe: Make the font red! No, black! Can we do both? PinmemberMarcus Kramer27-Dec-12 7:23 
GeneralRe: Make the font red! No, black! Can we do both? PinmemberZac Greve30-Dec-12 13:08 
GeneralRe: Make the font red! No, black! Can we do both? PinmemberRob Grainger4-Jan-13 10:58 
GeneralVal Grind (the wrong kind) PinmemberRob Grainger20-Dec-12 6:12 
From some legacy VB6 code I'm in the process of making redundant...
 
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) PinmemberNaerling20-Dec-12 11:40 
GeneralRe: Val Grind (the wrong kind) PinmemberNagy Vilmos20-Dec-12 23:55 
GeneralRe: Val Grind (the wrong kind) PinmemberBrady Kelly2-Jan-13 22:46 
GeneralRe: Val Grind (the wrong kind) PinmemberNagy Vilmos2-Jan-13 23:52 
GeneralRe: Val Grind (the wrong kind) PinmemberLesF4-Jan-13 10:51 
GeneralRe: Val Grind (the wrong kind) PinmemberRob Grainger4-Jan-13 11:09 
GeneralRe: Val Grind (the wrong kind) PinmemberNaerling4-Jan-13 12:56 
GeneralRe: Val Grind (the wrong kind) PinmemberMember 46088986-Jan-13 12:45 
GeneralRe: Val Grind (the wrong kind) PinmemberNaerling6-Jan-13 13:26 
GeneralRe: Val Grind (the wrong kind) PinmemberChris Quinn24-Dec-12 1:19 
GeneralRe: Val Grind (the wrong kind) PinmemberRob Grainger29-Dec-12 4:19 
GeneralRe: Val Grind (the wrong kind) PinmemberChris Quinn31-Dec-12 1:17 
GeneralRe: Val Grind (the wrong kind) PinmemberRob Grainger31-Dec-12 3:57 
AnswerRe: Val Grind (the wrong kind) PinmemberMark Hurd3-Jan-13 15:32 
GeneralRe: Val Grind (the wrong kind) [modified] PinmemberRob Grainger4-Jan-13 10:55 
GeneralRe: Val Grind (the wrong kind) PinmemberMark Hurd4-Jan-13 15:56 
GeneralRe: Val Grind (the wrong kind) Pinmemberplaystation328-Dec-12 22:22 
JokeRe: Val Grind (the wrong kind) PinmemberRafagaX3-Jan-13 5:57 
GeneralRe: Val Grind (the wrong kind) Pinmemberdshillito3-Jan-13 11:58 
GeneralRe: Val Grind (the wrong kind) [modified] PinmemberRob Grainger4-Jan-13 10:56 
GeneralRe: Val Grind (the wrong kind) Pinmembercpkilekofp11-Jan-13 8:02 
GeneralRe: Val Grind (the wrong kind) PinmemberRob Grainger11-Jan-13 8:42 
GeneralI am the Legend of Grimrock Poster PinmemberRob Grainger17-Dec-12 12:35 
GeneralRe: I am the Legend of Grimrock Poster PinmemberZac Greve17-Dec-12 18:25 
JokeRe: I am the Legend of Grimrock Poster PinmemberMember 829282421-Jan-13 4:01 
GeneralIt does what now? PinmemberMember 869907216-Dec-12 9:23 
GeneralRe: It does what now? PinmemberZac Greve16-Dec-12 10:47 
GeneralRe: It does what now? PinmemberBrady Kelly16-Dec-12 21:40 
GeneralRe: It does what now? PinprotectorPete O'Hanlon17-Dec-12 4:59 
GeneralRe: It does what now? Pinmemberkdmote17-Dec-12 6:51 
GeneralRe: It does what now? PinmemberMarius Bancila21-Dec-12 2:08 
GeneralRe: It does what now? Pinmemberjlopez78826-Dec-12 19:26 
AnswerRe: It does what now? PinmemberVUnreal8-Feb-13 11:32 
GeneralWho needs a UL? PinmemberAnalogNerd14-Dec-12 11:50 
GeneralRe: Who needs a UL? PinmemberBrady Kelly16-Dec-12 21:39 
GeneralRe: Who needs a UL? Pinmemberenglebart17-Dec-12 3:35 

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

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


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 27 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid