Что нового

Как правильно навести порядок в коде?

eus_deus

Новичок
Сообщения
118
Репутация
0
Всем привет!
Сильно не пинайте, просто я уже не знаю, что и как сделать. Наворотил кода, мне кажется, что можно и легче, но не знаю как. Как мне нормально навести в нем порядок?
Вот примеры бардака, коих очень много...
Код:
Case $vButton17
      GUICtrlSetData($vInput5, '')
      GUICtrlSetBkColor($vInput5, 0xF0F0F0)
      If GUICtrlRead($vInput1) = '' and GUICtrlRead($vInput2) = '' and GUICtrlRead($vInput3) = '' and GUICtrlRead($vInput4) = '' and GUICtrlRead($vInput6) = '' and GUICtrlRead($vInput7) = '' Then
        GUICtrlSetState($vButton11, $gui_disable)
        GUICtrlSetState($vButton12, $gui_disable)
      EndIf
      GUICtrlSetState($vButton17, $gui_disable)
      GUICtrlSetState($vButton28, $gui_disable)
      GUICtrlSetImage($vButton17, $sLib, 4, 0)
      GUICtrlSetImage($vButton28, $sLib, 5, 0)
    Case $vButton18
      GUICtrlSetData($vInput6, '')
      GUICtrlSetBkColor($vInput6, 0xF0F0F0)
      If GUICtrlRead($vInput1) = '' and GUICtrlRead($vInput2) = '' and GUICtrlRead($vInput3) = '' and GUICtrlRead($vInput4) = '' and GUICtrlRead($vInput5) = '' and GUICtrlRead($vInput7) = '' Then
        GUICtrlSetState($vButton11, $gui_disable)
        GUICtrlSetState($vButton12, $gui_disable)
      EndIf
      GUICtrlSetState($vButton18, $gui_disable)
      GUICtrlSetState($vButton30, $gui_disable)
      GUICtrlSetImage($vButton18, $sLib, 4, 0)
      GUICtrlSetImage($vButton30, $sLib, 5, 0)
    Case $vButton19
      GUICtrlSetData($vInput7, '')
      GUICtrlSetBkColor($vInput7, 0xF0F0F0)
      If GUICtrlRead($vInput1) = '' and GUICtrlRead($vInput2) = '' and GUICtrlRead($vInput3) = '' and GUICtrlRead($vInput4) = '' and GUICtrlRead($vInput5) = '' and GUICtrlRead($vInput6) = '' Then
        GUICtrlSetState($vButton11, $gui_disable)
        GUICtrlSetState($vButton12, $gui_disable)
      EndIf
      GUICtrlSetState($vButton19, $gui_disable)
      GUICtrlSetState($vButton32, $gui_disable)
      GUICtrlSetImage($vButton19, $sLib, 4, 0)
      GUICtrlSetImage($vButton32, $sLib, 5, 0)
    Case $vButton20
      ClipPut(GUICtrlRead($vInput1))
      GUICtrlSetData($vLabel8, $Cased[7] & GUICtrlRead($vInput1) & $Cased[8] & StringReplace(GUICtrlRead($vLabel1), ':', ''))
      Sleep(1500)
      GUICtrlSetData($vLabel8, '')
    Case $vButton21
      GUICtrlSetBkColor($vInput1, "0x" & ClipGet())
      GUICtrlSetData($vInput1, ClipGet())
      GUICtrlSetState($vButton11, $gui_enable)
      GUICtrlSetState($vButton12, $gui_enable)
      GUICtrlSetState($vButton13, $gui_enable)
      GUICtrlSetState($vButton20, $gui_enable)
      GUICtrlSetImage($vButton13, $sLib, 3, 0)
      GUICtrlSetImage($vButton20, $sLib, 2, 0)
    Case $vButton22
      ClipPut(GUICtrlRead($vInput2))
      GUICtrlSetData($vLabel8, $Cased[7] & GUICtrlRead($vInput2) & $Cased[8] & StringReplace(GUICtrlRead($vLabel2), ':', ''))
      Sleep(1500)
      GUICtrlSetData($vLabel8, '')
 
Верх