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

    −117

    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
    For t = 3 To u
     If Cells(t, 204).Text = " " Or Cells(t, 204).Text = "" Then
       If Cells(t + 1, 204).Text = " " Or Cells(t + 1, 204).Text = "" Then
        If Cells(t + 2, 204).Text = " " Or Cells(t + 2, 204).Text = "" Then
         If Cells(t + 3, 204).Text = " " Or Cells(t + 3, 204).Text = "" Then
         If Cells(t + 4, 204).Text = " " Or Cells(t + 4, 204).Text = "" Then
         If Cells(t + 5, 204).Text = " " Or Cells(t + 5, 204).Text = "" Then
         If Cells(t + 6, 204).Text = " " Or Cells(t + 6, 204).Text = "" Then
         If Cells(t + 7, 204).Text = " " Or Cells(t + 7, 204).Text = "" Then
         If Cells(t + 8, 204).Text = " " Or Cells(t + 8, 204).Text = "" Then
         If Cells(t + 9, 204).Text = " " Or Cells(t + 9, 204).Text = "" Then
         If Cells(t + 10, 204).Text = " " Or Cells(t + 10, 204).Text = "" Then
         If Cells(t + 11, 204).Text = " " Or Cells(t + 11, 204).Text = "" Then
         If Cells(t + 12, 204).Text = " " Or Cells(t + 12, 204).Text = "" Then
         If Cells(t + 13, 204).Text = " " Or Cells(t + 13, 204).Text = "" Then
         If Cells(t + 14, 204).Text = " " Or Cells(t + 14, 204).Text = "" Then
         If Cells(t + 15, 204).Text = " " Or Cells(t + 15, 204).Text = "" Then
         If Cells(t + 16, 204).Text = " " Or Cells(t + 16, 204).Text = "" Then
         If Cells(t + 17, 204).Text = " " Or Cells(t + 17, 204).Text = "" Then
         If Cells(t + 18, 204).Text = " " Or Cells(t + 18, 204).Text = "" Then
         If Cells(t + 19, 204).Text = " " Or Cells(t + 19, 204).Text = "" Then
         If Cells(t + 20, 204).Text = " " Or Cells(t + 20, 204).Text = "" Then
         If Cells(t + 21, 204).Text = " " Or Cells(t + 21, 204).Text = "" Then
         If Cells(t + 22, 204).Text = " " Or Cells(t + 22, 204).Text = "" Then
         If Cells(t + 23, 204).Text = " " Or Cells(t + 23, 204).Text = "" Then
         If Cells(t + 24, 204).Text = " " Or Cells(t + 24, 204).Text = "" Then
         If Cells(t + 25, 204).Text = " " Or Cells(t + 25, 204).Text = "" Then
         If Cells(t + 26, 204).Text = " " Or Cells(t + 26, 204).Text = "" Then
         If Cells(t + 27, 204).Text = " " Or Cells(t + 27, 204).Text = "" Then
         If Cells(t + 28, 204).Text = " " Or Cells(t + 28, 204).Text = "" Then
         If Cells(t + 29, 204).Text = " " Or Cells(t + 29, 204).Text = "" Then
         If Cells(t + 30, 204).Text = " " Or Cells(t + 30, 204).Text = "" Then
         If Cells(t + 31, 204).Text = " " Or Cells(t + 31, 204).Text = "" Then
         If Cells(t + 32, 204).Text = " " Or Cells(t + 32, 204).Text = "" Then
         If Cells(t + 33, 204).Text = " " Or Cells(t + 33, 204).Text = "" Then
         If Cells(t + 34, 204).Text = " " Or Cells(t + 34, 204).Text = "" Then
                  GoTo zan4:
              End If
            End If
          End If
        End If
         End If
         End If
            End If
          End If
        End If
         End If
         End If
            End If
          End If
        End If
         End If
         End If
            End If
          End If
        End If
         End If
         End If
            End If
          End If
        End If
         End If
         End If
            End If
          End If
        End If
         End If
         End If
            End If
          End If
        End If
         End If
    Next t
    zan4:

    Кусок реально используемого "проэкта", используется у нас на призводстве.
    И вот-такого штук 10 в коде.

    ноу коментс.

    adli__82, 21 Мая 2012

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

    −92

    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
    Sub Ìàêðîñ1()
      Sheets("Îò÷åò_Âêë.1_15-98").Select
        For i = 0 To 25 Step 1
            Sheets(Sheets.Count).Select
            If i = 0 Then
                Range("A:A, B:B").Select
            ElseIf i = 1 Then
                Range("A:A, C:C").Select
            ElseIf i = 2 Then
                Range("A:A, D:D").Select
            ElseIf i = 3 Then
                Range("A:A, E:E").Select
            ElseIf i = 4 Then
                Range("A:A, F:F").Select
            ElseIf i = 5 Then
                Range("A:A, G:G").Select
            ElseIf i = 6 Then
                Range("A:A, H:H").Select
            ElseIf i = 7 Then
                Range("A:A, I:I").Select
            ElseIf i = 8 Then
                Range("A:A, J:J").Select
            ElseIf i = 9 Then
                Range("A:A, K:K").Select
            ElseIf i = 10 Then
                Range("A:A, L:L").Select
            ElseIf i = 11 Then
                Range("A:A, M:M").Select
            ElseIf i = 12 Then
                Range("A:A, N:N").Select
            ElseIf i = 13 Then
                Range("A:A, O:O").Select
            ElseIf i = 14 Then
                Range("A:A, P:P").Select
            ElseIf i = 15 Then
                Range("A:A, Q:Q").Select
            ElseIf i = 16 Then
                Range("A:A, R:R").Select
            ElseIf i = 17 Then
                Range("A:A, S:S").Select
            ElseIf i = 18 Then
                Range("A:A, T:T").Select
            ElseIf i = 19 Then
                Range("A:A, U:U").Select
            ElseIf i = 20 Then
                Range("A:A, V:V").Select
            ElseIf i = 21 Then
                Range("A:A, W:W").Select
            ElseIf i = 22 Then
                Range("A:A, X:X").Select
            ElseIf i = 23 Then
                Range("A:A, Y:Y").Select
            ElseIf i = 24 Then
                Range("A:A, Z:Z").Select
            ElseIf i = 25 Then
                Range("A:A, AA:AA").Select
            End If
            Selection.Copy
            Sheets.Add
            Sheets(Sheets.Count - 1).Select
            Columns("A:A").Select
            ActiveSheet.Paste
        Next i
    End Sub

    Макрос для копирования подряд расположенных столбцов на отдельные листы

    usstass, 25 Апреля 2012

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

    −89

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    MdlСимметричность.Командная(СтИстБи, ФлагСим, КвоРабЧис)
                If ФлагСим = True Then ' тут мы сохраним столб истинности линейной функции и количество рабочих чисел
                    ФлагСим1 = True 'покажем, что хоть одна функция симметрична
                    СохранимНужнуюФункцию(СчетСим, КвоРабЧисЖмин, КвоРабЧис, СтИстБи, СтИстБиИскомыйСим)
                End If

    Как, пример, как нельзя называть и обзывать переменные и имена функций. Взято отсюда: http://www.sql.ru/forum/actualthread.aspx?tid=934300

    Ciana, 23 Апреля 2012

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

    −104

    1. 1
    Dim KolvoZnakov As String = IIf(SqlUser = "Beschastnova" Or SqlUser = "Rodionova", "00000", "00")

    Для двух привередливых бухов выводим аж 4 знака после запятой.

    axel1000, 22 Марта 2012

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

    −108

    1. 1
    Replace(Replace(Replace(Replace(Replace(sht1.Cells(i, 4).Value, "(кратность 4 шт)", ""), "O.F.", ""), "D1ECO", ""), "DECO", ""), "SK", "")

    Удаляем из ячейки Excel одно из возможно встречающихся в ней слов.

    Говнокод или вполне нормальный трюк?

    valemak, 28 Февраля 2012

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

    −90

    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
    L = InputBox("Введите номер вашего варианта", "Лабораторная работа №2")
    Label4.Caption = L
    
    If L > 50 Then
    MsgBox "Вы не ввели свой вариант, ввод варианта обязателен для корректной работы программы", vbExclamation, "Ошибка"
    L = InputBox("Введите номер вашего варианта", "Лабораторная работа №2")
    Label4.Caption = L
    End If
        If L > 50 Then
            MsgBox "Ошибка. Попробуйте запустить приложение снова и выполнить все действия", vbCritical, "Ошибка"
            End
    
    End If

    Третий раз не спрашиваем...

    vovams, 16 Февраля 2012

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

    −110

    1. 1
    2. 2
    If f <> "" Then Shell(Path, AppWinStyle.Hide)
            If f = "" Then Shell(Path)

    Угу, про Else тогда еще не слышали :)

    ipro, 12 Февраля 2012

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

    −112

    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
    'http://www.gotdotnet.ru/files/1003/
    Public Class Form1
        Public massiv(50), massiv1(50) As String
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim a As String
            a = " " + TextBox1.Text
            For i As Integer = 1 To a.Length - 1
                For j As Integer = 1 To 44
                    If a.Substring(i, 1).ToLower = massiv(j) Then
                        TextBox2.Text = TextBox2.Text + massiv1(j)
                        Exit For
                    End If
                Next
            Next
        End Sub
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            massiv(1) = "а"
            massiv(2) = "б"
            massiv(3) = "в"
            massiv(4) = "г"
            massiv(5) = "д"
            massiv(6) = "е"
            massiv(7) = "ё"
            massiv(8) = "ж"
            '...
            massiv(31) = "э"
            massiv(32) = "ю"
            massiv(33) = "я"
            massiv(34) = "1"
            massiv(35) = "2"
            massiv(36) = "3"
            massiv(37) = "4"
            massiv(38) = "5"
            massiv(39) = "6"
            massiv(40) = "7"
            massiv(41) = "8"
            massiv(42) = "9"
            massiv(43) = "0"
            massiv(44) = " "
            '  ////////////////////////////////////////////////////////////////////////////////////
            massiv1(1) = "1"
            massiv1(2) = "2"
            massiv1(3) = "3"
            massiv1(4) = "4"
            massiv1(5) = "5"
            massiv1(6) = "6"
            massiv1(7) = "7"
            massiv1(8) = "8"
            massiv1(9) = "9"
            massiv1(10) = "a"
            massiv1(11) = "b"
            massiv1(12) = "c"
            massiv1(13) = "d"
            '...
            massiv1(31) = "v"
            massiv1(32) = "w"
            massiv1(33) = "x"
            massiv1(34) = "<"
            massiv1(35) = ">"
            massiv1(36) = "!"
            massiv1(37) = "="
            massiv1(38) = "?"
            massiv1(39) = "/"
            massiv1(40) = "@"
            massiv1(41) = "~"
            massiv1(42) = "\"
            massiv1(43) = "-"
            massiv1(44) = "_"
    
        End Sub
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Dim g As String
            g = " " + TextBox1.Text
            For i As Integer = 1 To g.Length - 1
                For j As Integer = 1 To 44
                    If g.Substring(i, 1).ToLower = massiv1(j) Then
                        TextBox2.Text = TextBox2.Text + massiv(j)
                        Exit For
                    End If
                Next
            Next
        End Sub
    End Class

    dreesto, 11 Февраля 2012

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

    −98

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    For I = nrow_Start To nrow_Stop
        Do
            If Nrow_Frm1 = I Then Exit Do
            If Nrow_Frm2 = I Then Exit Do
            If Nrow_Frm3 = I Then Exit Do
            If Nrow_Frm4 = I Then Exit Do
        
            Cells(I, ncol_Period).FormulaR1C1 = formula
        Loop While False
    Next I

    И такое встречается..

    hexman, 25 Января 2012

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

    −107

    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
    GraphicsWindow.Width = 640
    GraphicsWindow.Height = 480
    
    GraphicsWindow.PenColor = "Yellow" 
    For i = 0 To 250
      GraphicsWindow.DrawLine(0 + i, 480 - i, 640 - i, 480 - i )
    EndFor
    
    GraphicsWindow.PenColor = "Orange"
    For i = 0 To 250 Step 10
      GraphicsWindow.DrawLine(0 + i, 480 - i, 640 - i, 480 - i)
    EndFor
    
    GraphicsWindow.BrushColor = "SteelBlue"
    GraphicsWindow.FillRectangle (0,0, 640 , 230)
    GraphicsWindow.BrushColor = "lightGreen"
    GraphicsWindow.FillTriangle(0, 480, 0, 230, 250, 230)
    GraphicsWindow.FillTriangle(640, 480, 640, 230, 390, 230)
    
    GraphicsWindow.BrushColor = "Orange"
    GraphicsWindow.FillEllipse (10, 30, 50, 50)  
    
    GraphicsWindow.PenColor = "Yellow"
    Turtle.Show()
    y = 0
    For i = 0 To 360 Step 30
    Turtle.X =35
    Turtle.Y = 55
    Turtle.Angle = i
    Turtle.PenUp()
    Turtle.Move(25)
    Turtle.PenDown()
    If y = 1 Then
      Turtle.Move(10)
      y = 0
    else  
      Turtle.Move(20)
      y = 1
    endif
    endfor

    KotoFey1ch, 23 Января 2012

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