1. VisualBasic / Говнокод #5378

    −457

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    Public Function CheckForError(ByVal sRes1 As String, ByVal sRes2 As String, Optional ByVal sRes3 As String = "", Optional ByVal sRes4 As String = "", Optional ByVal sRes5 As String = "", Optional ByVal sRes6 As String = "", Optional ByVal sRes7 As String = "", Optional ByVal sRes8 As String = "", Optional ByVal sRes9 As String = "", Optional ByVal sRes10 As String = "", Optional ByVal sRes11 As String = "") As Boolean
                Dim bRes As Boolean = True
                If Not CheckForError(sRes1) Then
                    If Not CheckForError(sRes2) Then
                        If Not CheckForError(sRes3) Then
                            If Not CheckForError(sRes4) Then
                                If Not CheckForError(sRes5) Then
                                    If Not CheckForError(sRes6) Then
                                        If Not CheckForError(sRes7) Then
                                            If Not CheckForError(sRes8) Then
                                                If Not CheckForError(sRes9) Then
                                                    If Not CheckForError(sRes10) Then
                                                        If Not CheckForError(sRes11) Then
                                                            bRes = False
                                                        End If
                                                    End If
                                                End If
                                            End If
                                        End If
                                    End If
                                End If
                            End If
                        End If
                    End If
                End If
    
                Return bRes
            End Function

    Птицы летят на юг!

    adler, 24 Января 2011

    Комментарии (13)
  2. VisualBasic / Говнокод #5206

    −174

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    Sub display(frm As Form)
        Dim lvl As Boolean
        Dim format As String
        If (frm.optSex(0).value) Then
            format = oI18n.translate("res_m")
            format = Replace(format, "\n", vbCrLf, 1, -1, vbBinaryCompare)
            format = Replace(format, "*", frm.cmbSchool.Text, 1, 1, vbTextCompare)
            format = Replace(format, "*", frm.txtForm.Text, 1, 1, vbTextCompare)
            format = Replace(format, "*", frm.txtName.Text, 1, 1, vbTextCompare)
            format = Replace(format, "*", frm.txtSurname.Text, 1, 1, vbTextCompare)
            lvl = False
            For Each optLvl In frm.chkLevel
                If (optLvl.value) Then
                    format = Replace(format, "*", oI18n.translate(optLvl.Tag & "_m"), 1, 1, vbTextCompare)
                    lvl = True
                End If
            Next optLvl
            If (Not lvl) Then format = Replace(format, "*", oI18n.translate("Bad" & "_m"), 1, 1, vbTextCompare)
        End If
        If (frm.optSex(1).value) Then
            format = oI18n.translate("res_f")
            format = Replace(format, "\n", vbCrLf, 1, -1, vbBinaryCompare)
            format = Replace(format, "*", frm.cmbSchool.Text, 1, 1, vbTextCompare)
            format = Replace(format, "*", frm.txtForm.Text, 1, 1, vbTextCompare)
            format = Replace(format, "*", frm.txtName.Text, 1, 1, vbTextCompare)
            format = Replace(format, "*", frm.txtSurname.Text, 1, 1, vbTextCompare)
            lvl = False
            For Each optLvl In frm.chkLevel
                If (optLvl.value) Then
                    format = Replace(format, "*", oI18n.translate(optLvl.Tag & "_f"), 1, 1, vbTextCompare)
                End If
            Next optLvl
            If (Not lvl) Then format = Replace(format, "*", oI18n.translate("Bad" & "_f"), 1, 1, vbTextCompare)
        End If
        Dim dalykai As String
        Dim first As Boolean
        dalykai = ""
        first = True
        For Each chkFavorite In frm.chkFavorites
            If (chkFavorite.value) Then dalykai = dalykai & IIf(first, vbCrLf, vbCrLf) & (chkFavorite.Caption)
            first = False
        Next chkFavorite
        If (frm.chkFavoriteOther.value) Then dalykai = dalykai & IIf(first, vbCrLf, vbCrLf) & (frm.txtFavoriteOther.Text)
        Dim b As Boolean
        b = dalykai = ""
        If (b) Then
            If (frm.optSex(0).value) Then dalykai = oI18n.translate("nores_m")
            If (frm.optSex(1).value) Then dalykai = oI18n.translate("nores_f")
        End If
        If (Not b) Then
            If (frm.optSex(0).value) Then dalykai = oI18n.translate("res2_m") & dalykai
            If (frm.optSex(1).value) Then dalykai = oI18n.translate("res2_f") & dalykai
        End If
        
        MsgBox (format & vbCrLf & dalykai)
    End Sub

    заполняем строку-шаблон, заменяя звездочки реальными данными
    вот не было в VB6 printf-подобной функции ((

    Lure Of Chaos, 10 Января 2011

    Комментарии (9)
  3. VisualBasic / Говнокод #5205

    −166

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    Public Sub DBOpen(Optional sFullPath As String = "")
        If sFullPath = "" Then sFullPath = sPath
        Dim f As Integer
        Dim l As Integer
        Dim tmp As String
        Dim sName As String
        Dim sSurname As String
        Dim sSex As String
        Dim dBirthdate As Date
        Dim sCity As String
        Dim sStreet As String
        l = 0
        f = FreeFile
        Open sFullPath For Input As #f
            While Not EOF(f)
                Line Input #f, tmp
                l = l + 1
            Wend
        Close #f
        If l > 0 Then
            ReDim asDB(0 To l - 1) As clsCitizen
            l = 0
            f = FreeFile
            Open sFullPath For Input As #f
                While Not EOF(f)
                    Input #f, sName, sSurname, sSex, dBirthdate, sCity, sStreet
                    Set asDB(l) = New clsCitizen
                    asDB(l).sName = sName
                    asDB(l).sSurname = sSurname
                    asDB(l).sSex = sSex
                    asDB(l).dBirthdate = dBirthdate
                    asDB(l).sCity = sCity
                    asDB(l).sStreet = sStreet
                    l = l + 1
                Wend
            Close #f
        End If
        sPath = sFullPath
    End Sub

    за что я ненавижу VB6

    а ведь по-другому никак = (

    Lure Of Chaos, 10 Января 2011

    Комментарии (12)
  4. VisualBasic / Говнокод #5204

    −166

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    Private Sub btnNew_Click()
        Dim i As Integer
        Dim asCopy() As clsCitizen
        ReDim asCopy(LBound(modCitizen.asDB) To UBound(modCitizen.asDB)) As clsCitizen
        For i = LBound(modCitizen.asDB) To UBound(modCitizen.asDB)
            Set asCopy(i) = modCitizen.asDB(i)
        Next i
        ReDim modCitizen.asDB(UBound(modCitizen.asDB) + 1) As clsCitizen
        For i = LBound(asCopy) To UBound(asCopy)
            Set modCitizen.asDB(i) = asCopy(i)
        Next i
        Set modCitizen.asDB(UBound(modCitizen.asDB)) = New clsCitizen
        modCitizen.asDB(UBound(modCitizen.asDB)).bNew = True
        iRecNum = UBound(modCitizen.asDB)
        RecordRead
        UpdateControls
        LockMe True
    End Sub

    вот через какое место мучительно вспоминал давно забытый, старый добрый VB6

    процедура дополняет массив новым элементом

    Lure Of Chaos, 10 Января 2011

    Комментарии (4)
  5. VisualBasic / Говнокод #5202

    −100

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    Private Sub Combo1_Click()
    
    Select Case Combo1.ListIndex
    
    Case 0
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\RaZeR.jpg")
    Case 1
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Serg.jpg")
    Case 2
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Nikton.jpg")
    Case 3
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Raider.jpg")
    Case 4
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Andrew.jpg")
    Case 5
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Gnum.jpg")
    Case 6
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Iron Man.jpg")
    Case 7
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Anakin.jpg")
    Case 8
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Nuparu.jpg")
    Case 9
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Deleted.jpg")
    Case 10
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\LEGOlas.jpg")
    Case 11
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Kit Fisto.jpg")
    Case 12
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Banky.jpg")
    Case 13
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Pazitiffniy.jpg")
    Case 14
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\GenKen.jpg")
    Case 15
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Dimanok.jpg")
    Case 16
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Drakon.jpg")
    Case 17
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\DJ Sim.jpg")
    Case 18
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Obi-Van.jpg")
    Case 19
    enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\Vitalya.jpg")
    Case 20
    enemy1.Picture = LoadPicture("data/Rescaled/LukeSW.jpg")
    Case 21
    enemy1.Picture = LoadPicture("data/Rescaled/Smegorik.jpg")
    Case 22
    enemy1.Picture = LoadPicture("data/Rescaled/Vitalya.jpg")
    Case 23
    enemy1.Picture = LoadPicture("data/Rescaled/DJ Sim.jpg")
    End Select
    
    
    End Sub
    
    
    Private Sub Combo2_Click()
    
    Select Case Combo2.ListIndex
    
    Case 0
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\RaZeR.jpg")
    Case 1
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Serg.jpg")
    Case 2
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Nikton.jpg")
    Case 3
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Raider.jpg")
    Case 4
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Andrew.jpg")
    Case 5
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Gnum.jpg")
    Case 6
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Iron Man.jpg")
    Case 7
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Anakin.jpg")
    Case 8
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Nuparu.jpg")
    Case 9
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Deleted.jpg")
    Case 10
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\LEGOlas.jpg")
    Case 11
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Kit Fisto.jpg")
    Case 12
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Banky.jpg")
    Case 13
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Pazitiffniy.jpg")
    Case 14
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\GenKen.jpg")
    Case 15
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Dimanok.jpg")
    Case 16
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\Drakon.jpg")
    Case 17
    enemy2.Picture = LoadPicture(App.Path & "\data\Rescaled\DJ Sim.jpg")

    Тот же источник, что и #5201. Загрузка картинок из тех самых комбобоксов. А ведь можно было enemy1.Picture = LoadPicture(App.Path & "\data\Rescaled\" & Combo1.SelectedItem & ".jpg").

    RaZeR, 10 Января 2011

    Комментарии (5)
  6. VisualBasic / Говнокод #5201

    −101

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    Combo1.AddItem "RaZeR", 0
    Combo1.AddItem "Serg", 1
    Combo1.AddItem "Nikton", 2
    Combo1.AddItem "Raider", 3
    Combo1.AddItem "Andrew_18", 4
    Combo1.AddItem "Gnum", 5
    Combo1.AddItem "Iron Man", 6
    Combo1.AddItem "Anakin", 7
    Combo1.AddItem "Nuparu", 8
    Combo1.AddItem "Deleted", 9
    Combo1.AddItem "LEGOлас", 10
    Combo1.AddItem "Kit Fisto", 11
    Combo1.AddItem "Banky", 12
    Combo1.AddItem "Пазитифффный", 13
    Combo1.AddItem "Генерал Кеноби", 14
    Combo1.AddItem "Диманок Филин", 15
    Combo1.AddItem "Дракон", 16
    Combo1.AddItem "DJ Sim", 17
    Combo1.AddItem "Obi-Van", 18
    Combo1.AddItem "Виталя", 19
    Combo1.AddItem "ЛюкСкайуокер", 20
    Combo1.AddItem "Смегорик", 21
    Combo1.AddItem "KAPITAN REX", 22
    Combo1.AddItem "Вячеслав", 23
    
    Combo2.AddItem "RaZeR", 0
    Combo2.AddItem "Serg", 1
    Combo2.AddItem "Nikton", 2
    Combo2.AddItem "Raider", 3
    Combo2.AddItem "Andrew_18", 4
    Combo2.AddItem "Gnum", 5
    Combo2.AddItem "Iron Man", 6
    Combo2.AddItem "Anakin", 7
    Combo2.AddItem "Nuparu", 8
    Combo2.AddItem "Deleted", 9
    Combo2.AddItem "LEGOлас", 10
    Combo2.AddItem "Kit Fisto", 11
    Combo2.AddItem "Banky", 12
    Combo2.AddItem "Пазитифффный", 13
    Combo2.AddItem "Генерал Кеноби", 14
    Combo2.AddItem "Диманок Филин", 15
    Combo2.AddItem "Дракон", 16
    Combo2.AddItem "DJ Sim", 17
    Combo2.AddItem "Obi-Van", 18
    Combo2.AddItem "Виталя", 19
    Combo2.AddItem "ЛюкСкайуокер", 20
    Combo2.AddItem "Смегорик", 21
    Combo2.AddItem "KAPITAN REX", 22
    Combo2.AddItem "Вячеслав", 23
    
    Combo3.AddItem "RaZeR", 0
    Combo3.AddItem "Serg", 1
    Combo3.AddItem "Nikton", 2
    Combo3.AddItem "Raider", 3
    Combo3.AddItem "Andrew_18", 4
    Combo3.AddItem "Gnum", 5
    Combo3.AddItem "Iron Man", 6
    Combo3.AddItem "Anakin", 7
    Combo3.AddItem "Nuparu", 8
    Combo3.AddItem "Deleted", 9
    Combo3.AddItem "LEGOлас", 10
    Combo3.AddItem "Kit Fisto", 11
    Combo3.AddItem "Banky", 12
    Combo3.AddItem "Пазитифффный", 13
    Combo3.AddItem "Генерал Кеноби", 14
    Combo3.AddItem "Диманок Филин", 15
    Combo3.AddItem "Дракон", 16
    Combo3.AddItem "DJ Sim", 17
    Combo3.AddItem "Obi-Van", 18
    Combo3.AddItem "Виталя", 19
    Combo3.AddItem "ЛюкСкайуокер", 20
    Combo3.AddItem "Смегорик", 21
    Combo3.AddItem "KAPITAN REX", 22
    Combo3.AddItem "Вячеслав", 23

    VB6, заполнение трёх комбо-боксов одинаковыми пунктами. А если бы комбобоксов было 20?

    RaZeR, 10 Января 2011

    Комментарии (11)
  7. VisualBasic / Говнокод #5200

    −103

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    Dim tmpStr As String = ""
    
            If E >= 100 And E <= 109 Then tmpStr = "Жёлтый"
            If E >= 110 And E <= 119 Then tmpStr = "Оранжевый"
            If E >= 120 And E <= 129 Then tmpStr = "Красный"
            If E >= 130 And E <= 139 Then tmpStr = "Синий/Фиолетовый"
            If E >= 140 And E <= 149 Then tmpStr = "Зелёный"
            If E >= 150 And E <= 159 Then tmpStr = "Коричневый/Чёрный"
            If E >= 160 And E <= 199 Then tmpStr = "Другие"
    
            If E >= 200 And E <= 209 Then tmpStr = "Сорбат"
            If E >= 210 And E <= 219 Then tmpStr = "Бензоат"
            If E >= 220 And E <= 229 Then tmpStr = "Сульфит"
            If E >= 230 And E <= 239 Then tmpStr = "Фенол/Формиат(метаноат)"
            If E >= 240 And E <= 259 Then tmpStr = "Нитрат"
            If E >= 260 And E <= 269 Then tmpStr = "Ацетат (этаноат)"
            If E >= 270 And E <= 279 Then tmpStr = "Лактат"
            If E >= 280 And E <= 289 Then tmpStr = "Пропиноат (пропаноат)"
            If E >= 290 And E <= 299 Then tmpStr = "Другие"
    
            If E >= 300 And E <= 305 Then tmpStr = "Сорбат"
            If E >= 306 And E <= 309 Then tmpStr = "Бензоат"
            If E >= 310 And E <= 319 Then tmpStr = "Сульфит"
            If E >= 320 And E <= 329 Then tmpStr = "Фенол/Формиат(метаноат)"
            If E >= 330 And E <= 339 Then tmpStr = "Нитрат"
            If E >= 340 And E <= 349 Then tmpStr = "Ацетат (этаноат)"
            If E >= 350 And E <= 359 Then tmpStr = "Лактат"
            If E >= 360 And E <= 369 Then tmpStr = "Пропиноат (пропаноат)"
            If E >= 370 And E <= 399 Then tmpStr = "Другие"
    
            If E >= 400 And E <= 409 Then tmpStr = "Альгинат"
            If E >= 410 And E <= 419 Then tmpStr = "Камедь"
            If E >= 420 And E <= 429 Then tmpStr = "Природное вещество"
            If E >= 430 And E <= 439 Then tmpStr = "Соединение полиоксиэтилена"
            If E >= 440 And E <= 449 Then tmpStr = "Природный эмульгатор"
            If E >= 450 And E <= 459 Then tmpStr = "Фосфат"
            If E >= 460 And E <= 469 Then tmpStr = "Соединение целлюлозы"
            If E >= 470 And E <= 489 Then tmpStr = "Соединение жирных кислот"
            If E >= 490 And E <= 499 Then tmpStr = "Другие"
    
            If E >= 500 And E <= 509 Then tmpStr = "Неорганическая кислота/основание"
            If E >= 510 And E <= 519 Then tmpStr = "Хлорид/Сульфат"
            If E >= 520 And E <= 529 Then tmpStr = "Сульфат/Гидроксид"
            If E >= 530 And E <= 549 Then tmpStr = "Соединение щелочных металлов"
            If E >= 550 And E <= 559 Then tmpStr = "Силикат"
            If E >= 570 And E <= 579 Then tmpStr = "Стеарат/Глюконат"
            If E >= 580 And E <= 599 Then tmpStr = "Другие"
    
            If E >= 620 And E <= 629 Then tmpStr = "Глютамат"
            If E >= 630 And E <= 639 Then tmpStr = "Инозинат"
            If E >= 640 And E <= 649 Then tmpStr = "Другие"
    
            If E >= 900 And E <= 909 Then tmpStr = "Воск"
            If E >= 910 And E <= 919 Then tmpStr = "Глазирователь"
            If E >= 920 And E <= 929 Then tmpStr = "Вещество, улучшающее мучное изделие"
            If E >= 930 And E <= 949 Then tmpStr = "Газ для упаковки"
            If E >= 950 And E <= 969 Then tmpStr = "Подсластитель"
            If E >= 990 And E <= 999 Then tmpStr = "Пенообразователь"

    Мой очень древний высер - программка на определение пищевых добавок "Е". Похожих фрагментов есть ещё несколько. И не лень было печатать! Select Case сюда бы больше подошёл, но я о нём тогда не знал.

    RaZeR, 10 Января 2011

    Комментарии (3)
  8. VisualBasic / Говнокод #5198

    −102

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    Private Sub DoIt()
            System.Threading.Thread.Sleep(3000)
            SetCursorPos(1012, 373)
            LeftClick()
            
            System.Threading.Thread.Sleep(4000)
            SetCursorPos(526, 273)
            LeftClick()
            
            System.Threading.Thread.Sleep(2000)
            SetCursorPos(412, 330)
            LeftClick()
           
            System.Threading.Thread.Sleep(3000)
            SetCursorPos(414, 503)
            LeftClick()
            
            System.Threading.Thread.Sleep(5000)
            SetCursorPos(659, 333)
            LeftClick()
           
            System.Threading.Thread.Sleep(3000)
            SetCursorPos(622, 390)
            LeftClick()
            
            System.Threading.Thread.Sleep(7000)
            SetCursorPos(659, 333)
            LeftClick()
    
            System.Threading.Thread.Sleep(3000)
            SetCursorPos(622, 390)
            LeftClick()
    
            System.Threading.Thread.Sleep(8000)
            SetCursorPos(659, 333)
            LeftClick()
    
            System.Threading.Thread.Sleep(2000)
            SetCursorPos(622, 390)
            LeftClick()
    
            System.Threading.Thread.Sleep(6000)
            SetCursorPos(659, 333)
            LeftClick()
    
            System.Threading.Thread.Sleep(3000)
            SetCursorPos(622, 390)
            LeftClick()
    
            System.Threading.Thread.Sleep(5000)
            SetCursorPos(660, 533)
            LeftClick()
        End Sub

    Мой древний код одного кликера. Обратите внимание на отличный способ таймаута между командами (а ведь у проги и GUI есть, как его так обновлять?) Как потом позже скажет один мой знакомый - "Время между командами - важно".

    RaZeR, 10 Января 2011

    Комментарии (1)
  9. VisualBasic / Говнокод #4759

    −109

    1. 1
    23, 0x8e, 0xc9, 0x5a, 0x19, 0x1f, 0x5d, 0xea, 0xe7, 0xb1, 0xae, 0x72, 0xf8, 0x8f, 0xed, 0x54, 0x45, 0x5f, 0x29, 0xf, 0xee, 0x3f, 0xb8, 0xe0, 0xfc, 0x53, 0x3d, 0x9c, 0xa4, 0x75, 0xb7, 0xee, 0x58, 0xda, 0xf1, 0x35, 0x9b, 0x26, 0xb6, 0x35, 0x8d, 0x46, 0xbb, 0x52, 0xf5, 0x44, 0x4e, 0x8a, 0x5, 0x7f, 0x20, 0xda, 0x99, 0xc4, 0xec, 0xd3, 0xdd, 0xb6, 0x89, 0x1f, 0x1b, 0x1d, 0x26, 0x89, 0x61, 0x73, 0x95, 0x51, 0xdf, 0xcd, 0xa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0, 0x0, 0x0, 0x7, 0xff, 0xd9").Split(", ").Select(Function(x) Byte.Parse(x)).ToArray()

    jpeg

    nCdy, 26 Ноября 2010

    Комментарии (29)
  10. VisualBasic / Говнокод #4743

    −102

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    flagnum=Isnumeric(pSum$) 'сумма к погашению
    If flagnum=False Then
    	If Instr(pSum$,",")=0 Then
    		flagnum1$=Strleft(pSum$,".")
    		flagnum2$=Strrightback(pSum$,".")
    		pSum$=flagnum1$&","&flagnum2$
    	Else
    		flagnum1$=Strleft(pSum$,",")
    		flagnum2$=Strrightback(pSum$,",")
    		pSum$=flagnum1$&"."&flagnum2$
    	End If
    End If

    LotusScript
    Преобразования строкового представления числа в число. При входе "0" на выходе строка ".", которая пытается безусловно быть преображена в число.

    Dimly, 25 Ноября 2010

    Комментарии (1)