Click here to Skip to main content
15,909,205 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.

 
GeneralRe: Something's out of round here Pin
Bigdeak10-Oct-10 23:15
Bigdeak10-Oct-10 23:15 
GeneralClever Convert. Really? PinPopular
Svetlin Panayotov8-Oct-10 3:28
Svetlin Panayotov8-Oct-10 3:28 
GeneralRe: Clever Convert. Really? Pin
GibbleCH8-Oct-10 3:35
GibbleCH8-Oct-10 3:35 
GeneralRe: Clever Convert. Really? Pin
Svetlin Panayotov8-Oct-10 3:54
Svetlin Panayotov8-Oct-10 3:54 
GeneralRe: Clever Convert. Really? Pin
Jörgen Sigvardsson9-Oct-10 21:11
Jörgen Sigvardsson9-Oct-10 21:11 
GeneralRe: Clever Convert. Really? Pin
BillW338-Oct-10 3:48
professionalBillW338-Oct-10 3:48 
GeneralRe: Clever Convert. Really? Pin
Matt Gerrans8-Oct-10 20:16
Matt Gerrans8-Oct-10 20:16 
Generalvb 6, ep. 3 PinPopular
Lutosław7-Oct-10 14:53
Lutosław7-Oct-10 14:53 
Oh, that was great days...

VB
Private Sub Command16_Click()
 Open asc & "Read" & File2.FileName For Input As #1
  Line Input #1, dat
  Line Input #1, doo
  Line Input #1, od
  Line Input #1, temat
 Close
 Form2.Text1 = "Answer - " & od
 Form2.Text2 = doo
 Form2.Text3 = "Answer - " & temat
 Form2.Text4 = "This is an answer to a message received in " & dat & "."
 Form2.Show
End Sub

Private Sub Command6_Click()
 Form4.Show
End Sub

Private Sub Command7_Click()
 Frame1.Visible = True
 Frame2.Visible = False
 Frame3.Visible = False
  Frame4.Visible = False
 File1.Refresh
End Sub

Private Sub Command8_Click()
 Frame1.Visible = False
 Frame2.Visible = True
 Frame3.Visible = False
  Frame4.Visible = False
 File2.Refresh
End Sub


Private Sub Command9_Click()
 Frame1.Visible = False
 Frame2.Visible = False
 Frame3.Visible = True
 Frame4.Visible = False
 File3.Refresh
End Sub

Private Sub File1_DblClick()
 If File1.ListIndex = -1 Then Exit Sub
  sws = File1
  Form3.Show
End Sub
'
' ( 22 handlers named Command1_Click to Command22_Click )
'
Private Sub Form_Load()
On Error GoTo 1
 'Exit Sub
 Label5 = "Welcome, it's " & Format$(Now, "long date") & ", time" & Time$
 ChDir App.Path
 asc = App.Path & "\"
 Label4 = asc & "user.ini"
 Command7.Picture = LoadPicture(asc & "unr.ico")
 Command8.Picture = LoadPicture(asc & "read.ico")
 Command9.Picture = LoadPicture(asc & "deleted.ico")
 Command10.Picture = LoadPicture(asc & "user.ico")
 If Len(App.Path) = 3 Then asc = App.Path
 Close
 On Error GoTo 6
7:
 'Open asc & "opwp.ini" For Input As #1
 ' Line Input #1, ow
 ' owp = ow
 'Close
 Load Form8
 Open asc & "InLookcon.ini" For Input As #1
 Line Input #1, d1
 Line Input #1, d2
 Line Input #1, d3
 Close #1
 File1.Path = d1
 If d2 = "ask" Then
  If File1.ListCount = 0 Then
   X = MsgBox("There are no new messages. Do you want to start InLook?", 32 + 4)
   If Not X = 6 Then End
  End If
 ElseIf d2 = "norun" Then
  End
 End If
 Label1 = d1
 zapis = d3
 On Error Resume Next
 File2.Path = asc & "Read"
 If Err > 0 Then
  MkDir asc & "Read"
  Err = 0
 End If
 File2.Path = asc & "Read"
 Label2 = File2.Path
 File3.Path = asc & "Deleted"
 If Err > 0 Then
  MkDir asc & "Deleted"
  Err = 0
 End If
 File3.Path = asc & "Deleted"
 Label3 = File3.Path
 On Error GoTo 2
4:
 Open asc & "user.ini" For Input As #1
3:
 If Not EOF(1) Then
  Line Input #1, a
  List1.AddItem a
  GoTo 3
 End If
 Close
 Open asc & "usop.ini" For Input As #1
  Line Input #1, opu
  opus = opu
 Close
 Exit Sub
1:
 MsgBox "Error. Required files are missing I suppose. Run ''Repair.exe''!", 0 + 16
 End
 Resume
2:
Close
 Open asc & "user.ini" For Output As #1
 Print #1, "Error occured: users was reset."
 Close
 GoTo 6
Resume
6:
Open asc & "opwp.ini" For Output As #1
 Print #1, "1"
Close #1
GoTo 7
End Sub


...
Greetings - Jacek

GeneralRe: vb 6, ep. 3 PinPopular
OriginalGriff7-Oct-10 21:49
mveOriginalGriff7-Oct-10 21:49 
GeneralRe: vb 6, ep. 3 Pin
Lutosław8-Oct-10 2:56
Lutosław8-Oct-10 2:56 
GeneralRe: vb 6, ep. 3 Pin
Matt Gerrans8-Oct-10 20:20
Matt Gerrans8-Oct-10 20:20 
GeneralRe: vb 6, ep. 3 Pin
Lutosław9-Oct-10 1:20
Lutosław9-Oct-10 1:20 
GeneralRe: vb 6, ep. 3 Pin
Matt Gerrans9-Oct-10 19:27
Matt Gerrans9-Oct-10 19:27 
GeneralRe: vb 6, ep. 3 Pin
Lutosław10-Oct-10 20:12
Lutosław10-Oct-10 20:12 
GeneralRe: vb 6, ep. 3 Pin
_Erik_15-Oct-10 5:34
_Erik_15-Oct-10 5:34 
GeneralDating Pin
QuiJohn6-Oct-10 9:06
QuiJohn6-Oct-10 9:06 
GeneralRe: Dating Pin
Luc Pattyn6-Oct-10 9:15
sitebuilderLuc Pattyn6-Oct-10 9:15 
GeneralRe: Dating Pin
PIEBALDconsult6-Oct-10 19:00
mvePIEBALDconsult6-Oct-10 19:00 
GeneralRe: Dating Pin
BillW337-Oct-10 8:36
professionalBillW337-Oct-10 8:36 
GeneralRe: Dating Pin
Bernhard Hiller7-Oct-10 0:01
Bernhard Hiller7-Oct-10 0:01 
GeneralRe: Dating Pin
Daniel 'Tak' M.7-Oct-10 3:52
Daniel 'Tak' M.7-Oct-10 3:52 
GeneralRe: Dating Pin
Jeremy Hutchinson7-Oct-10 5:27
professionalJeremy Hutchinson7-Oct-10 5:27 
GeneralRe: Dating Pin
Camilo Sanchez7-Oct-10 12:05
Camilo Sanchez7-Oct-10 12:05 
AnswerRe: Dating Pin
Luc Pattyn7-Oct-10 8:56
sitebuilderLuc Pattyn7-Oct-10 8:56 
GeneralRe: Dating Pin
Stefan_Lang8-Oct-10 3:35
Stefan_Lang8-Oct-10 3:35 

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.