Code Snippets from Hell

Da ich grad bei Code-Snippets war; zurzeit verzweifle ich beim Umsetzen von VB6-Code nach C# 4 in ASP.NET.

Das ist mein heutiges Morgen-Highlight:

For n = 1 To List1(0).ListCount
    a$ = List1(0).List(n - 1)
    Mid(a$, 99, 1) = " "
    Select Case a1$
        Case "0"
            If Mid(a$, 34, 1) = a1$ Then
                If a2$ = "B" And Mid(a$, 20, 1) = "B" Then Mid(a$, 99, 1) = "*"
                If Trim(Mid(a$, 20, 5)) = a2$ Or a2$ = "" Then
                    Mid(a$, 99, 1) = "*"
                End If
            End If
            List1(0).List(n - 1) = a$
        Case Else
            If Mid(a$, 34, 1) = a1$ Or (a1$ = "5" And Mid(a$, 34, 1) <> "0") Then
                If a2$ = "B" And Mid(a$, 20, 1) = "B" Then Mid(a$, 99, 1) = "*"
                If Trim(Mid(a$, 20, 5)) = a2$ Or a2$ = "" Then
                    Mid(a$, 99, 1) = "*"
                End If
            End If
            List1(0).List(n - 1) = a$
    End Select
Next n

Mir ist völlig suspekt, was der Code macht und ich habe keine Ahnung, wie der ursprüngliche Autor das nach einem Tag selbst noch verstehen will.

Hilfe!

5 thoughts on “Code Snippets from Hell

  1. da fehlt doch die hälfte :) a1$ wird z.b. nie gesetzt aber im switchblock verwendet.

    aber das hier ist echt genial:

    Mid(a$, 99, 1) = “*”

  2. Von Softwareentwicklung und Codierung hat derjenige soviel Ahnung, wie ein Lehrer vom Leben oder ne Kuh vom Fliegen.

    Sorry, aber DAS war mal ein richtig krankes Gehirn oder es war 3 Uhr in der Nacht und Kaffee war alle.

  3. Pingback: Spam from Hell « Magerquark.de

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>