Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted by NoNameZ ( 16 years ago )
Private Sub about_autor_Click()
Load about_me
about_me.Show
End Sub

Private Sub about_programm_Click()
Load programm
programm.Show
End Sub

Private Sub Clean_Click()
Call Clear
End Sub

Private Sub clean_it_Click()
Call Clear
End Sub

Private Sub exit_Click()
End
End Sub

Private Sub Fill_Click()
Text19.Text = 180
Text20.Text = 40
Text21.Text = 160
Text22.Text = 120
Text23.Text = 100
Text24.Text = 600
Text16.Text = 240
Text17.Text = 160
Text18.Text = 200
Call Error_clean
End Sub

Private Sub fill_it_Click()
Call Fill_Click
End Sub

Private Sub Form_Load()
Call Error_clean
End Sub

Private Sub help_Click()
Load hlp
hlp.Show
End Sub

Private Sub help_me_Click()
Load hlp
hlp.Show
End Sub

Private Sub Solve_Click()
'Äåéñòâóþøèå ëèöà:
Dim T(6, 4) As Double 'Ìàòðèöà,â êîòîðîé ïðîèçâîäÿòñÿ âñå äåéñòâèÿ
Dim S1 As Double      'Cóììà òîâàðà âñåõ çàêàçîâ
Dim S2 As Double      'Ñóììà òîâàðà âñåõ ñêëàäîâ
Dim n As Variant      'Íàïðàâëåíèå äâèæåíèÿ ïî ìàòðèöå
Dim ost1 As Double      'Îñòàòîê 1
Dim ost2 As Double      'Îñòàòîê 2
Dim ost3 As Double      'Îñòàòîê 3
Dim ost4 As Double      'Îñòàòîê 4
Dim ost5 As Double      'Îñòàòîê 5


'Î÷èùàåì êîíñîëü îøèáîê
Call Error_clean


'Î÷èùàåì ÿ÷åéêè
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text24.Text = ""

'Ïðîâåðÿåì ââîäèìûå ïîëÿ íà ïðàâèëüíîñòü ââîäèìîãî òèïà äàííûõ

If Not IsNumeric(Text16.Text) Then
    Text25.Text = "Ââîäèòü áóêâû - Íåëüçÿ! Ââåäèòå öèôðó!"
    Text16.BackColor = &H80FF;&
    about_err.Visible = True
    
Else
    T(6, 1) = Val(Text16.Text)
End If


  If Not IsNumeric(Text17.Text) Then
      Text25.Text = "Ââîäèòü áóêâû - Íåëüçÿ! Ââåäèòå öèôðó!"
      Text17.BackColor = &H80FF;&
  Else
      T(6, 2) = Val(Text17.Text)
  End If

    If Not IsNumeric(Text18.Text) Then
        Text25.Text = "Ââîäèòü áóêâû - Íåëüçÿ! Ââåäèòå öèôðó!"
        Text18.BackColor = &H80FF;&
    Else
        T(6, 3) = Val(Text18.Text)
    End If

      If Not IsNumeric(Text19.Text) Then
          Text25.Text = "Ââîäèòü áóêâû - Íåëüçÿ! Ââåäèòå öèôðó!"
          Text19.BackColor = &H80FF;&
      Else
          T(1, 4) = Val(Text19.Text)
      End If

        If Not IsNumeric(Text20.Text) Then
            Text25.Text = "Ââîäèòü áóêâû - Íåëüçÿ! Ââåäèòå öèôðó!"
            Text20.BackColor = &H80FF;&
        Else
            T(2, 4) = Val(Text20.Text)
        End If

          If Not IsNumeric(Text21.Text) Then
              Text25.Text = "Ââîäèòü áóêâû - Íåëüçÿ! Ââåäèòå öèôðó!"
              Text21.BackColor = &H80FF;&
          Else
              T(3, 4) = Val(Text21.Text)
          End If

            If Not IsNumeric(Text22.Text) Then
                Text25.Text = "Ââîäèòü áóêâû - Íåëüçÿ! Ââåäèòå öèôðó!"
                Text22.BackColor = &H80FF;&
            Else
                T(4, 4) = Val(Text22.Text)
            End If
            
              If Not IsNumeric(Text23.Text) Then
                  Text25.Text = "Ââîäèòü áóêâû - Íåëüçÿ! Ââåäèòå öèôðó!"
                  Text23.BackColor = &H80FF;&
              Else
                  T(5, 4) = Val(Text23.Text)
              End If

'Ïîäñ÷èòûâàåì ñóììó òîâàðà âñåõ çàêàçîâ
S1 = T(1, 4) + T(2, 4) + T(3, 4) + T(4, 4) + T(5, 4)
'Ïîäñ÷èòûâàåì ñóììó òîâàðà âñåõ ñêëàäîâ
S2 = T(6, 1) + T(6, 2) + T(6, 3)
     
'Ïðîâåðÿåì , ðàâíà ëè ñóììà òîâàðîâ â çàêàçàõ ,ñóìììå òîâàðà íà ñêëàäå
If S1 <> S2 Then
    Text25.Text = "Ñóììà âñåõ çàÿâîê ÍÅ ðàâíà ñóììå âñåõ çàïàñîâ. Ââåäèòå äðóãèå äàííûå!"
Else
    'Çàíîñèì ñóììó â ÿ÷åéêó
    T(6, 4) = S1
    Text24.Text = T(6, 4)
    
    'Åñëè
    If T(6, 1) >= T(1, 4) Then
        T(1, 1) = T(1, 4)
        ost1 = T(6, 1) - T(1, 4)
        Text1.Text = T(1, 1)
        n = p
        If ost1 >= T(2, 4) Then
            T(2, 1) = T(2, 4)
            ost2 = ost1 - T(2, 4)
            Text2.Text = T(2, 1)
            n = p
            If ost2 >= T(3, 4) Then
                T(3, 1) = T(3, 4)
                ost3 = ost2 - T(3, 4)
                Text3.Text = T(3, 1)
                n = p
                If ost3 >= T(4, 4) Then
                    T(4, 1) = T(4, 4)
                    ost4 = ost3 - T(4, 4)
                    T(5, 1) = ost4
                    T(5, 2) = T(6, 2)
                    T(5, 3) = T(6, 3)
                    Text4.Text = T(4, 1)
                    Text5.Text = T(5, 1)
                    Text10.Text = T(5, 2)
                    Text15.Text = T(5, 3)
                Else
                    T(4, 1) = ost3
                    ost4 = T(4, 4) - ost3
                    Text4.Text = T(4, 1)
                    n = V
                    If T(6, 2) >= ost4 Then
                        T(4, 2) = ost4
                        ost5 = T(6, 2) - ost4
                        T(5, 2) = ost5
                        T(5, 3) = T(6, 3)
                        Text9.Text = T(4, 2)
                        Text10.Text = T(5, 2)
                        Text15.Text = T(5, 3)
                    Else
                        T(4, 2) = T(6, 2)
                        Text9.Text = T(4, 2)
                        n = V
                        T(4, 3) = T(4, 4) - T(4, 1) - T(4, 2)
                        T(5, 3) = T(5, 4)
                        Text14.Text = T(4, 3)
                        Text15.Text = T(5, 3)
                    End If
                End If
            Else
                n = V
                T(3, 1) = ost2
                Text3.Text = T(3, 1)
                ost3 = T(3, 4) - ost2
                n = p
                If T(6, 2) >= ost3 Then
                    T(3, 2) = ost3
                    ost4 = T(6, 2) - ost3
                    Text8.Text = T(3, 2)
                    n = p
                    If ost4 >= T(4, 4) Then
                        T(4, 2) = T(4, 4)
                        Text9.Text = T(4, 2)
                        n = p
                        T(5, 2) = T(6, 2) - ost3 - T(4, 2)
                        T(5, 3) = T(6, 3)
                        Text10.Text = T(5, 2)
                        Text15.Text = T(5, 3)
                    Else
                        T(4, 2) = ost4
                        Text9.Text = T(4, 2)
                        n = V
                        T(4, 3) = T(4, 4) - ost4
                        T(5, 3) = T(5, 4)
                        Text14.Text = T(4, 3)
                        Text15.Text = T(5, 3)
                    End If
                Else
                    T(3, 2) = T(6, 2)
                    Text8.Text = T(3, 2)
                    n = V
                    ost4 = ost3 - T(6, 2)
                    T(3, 3) = ost4
                    T(4, 3) = T(4, 4)
                    T(5, 3) = T(5, 4)
                    Text13.Text = T(3, 3)
                    Text14.Text = T(4, 3)
                    Text15.Text = T(5, 3)
                End If
            End If
        Else
            T(2, 1) = ost1
            ost2 = T(2, 4) - ost1
            Text2.Text = T(2, 1)
            n = V
            If T(6, 2) >= ost2 Then
                T(2, 2) = ost2
                ost3 = T(6, 2) - ost2
                Text7.Text = T(2, 2)
                n = p
                If ost3 >= T(3, 4) Then
                    T(3, 2) = T(3, 4)
                    ost4 = ost3 - T(3, 4)
                    Text8.Text = T(3, 2)
                    n = p
                    If ost4 >= T(4, 4) Then
                        T(4, 2) = T(4, 4)
                        Text9.Text = T(4, 2)
                        ost5 = ost4 - T(4, 4)
                        n = p
                        T(5, 2) = ost5
                        T(5, 3) = T(6, 3)
                        Text10.Text = T(5, 2)
                        Text15.Text = T(5, 3)
                    Else
                        n = V
                        T(4, 2) = ost4
                        T(4, 3) = T(4, 4) - ost4
                        T(5, 3) = T(5, 4)
                        Text9.Text = T(4, 2)
                        Text14.Text = T(4, 3)
                        Text15.Text = T(5, 3)
                    End If
                Else
                    T(3, 2) = ost3
                    Text8.Text = T(3, 2)
                    n = V
                    ost4 = T(3, 4) - T(3, 2)
                    T(3, 3) = ost4
                    T(4, 3) = T(4, 4)
                    T(5, 3) = T(5, 4)
                    Text13.Text = T(3, 3)
                    Text14.Text = T(4, 3)
                    Text15.Text = T(5, 3)
                End If
            Else
                T(2, 2) = T(6, 2)
                T(2, 3) = T(2, 4) - ost1 - T(6, 2)
                T(3, 3) = T(3, 4)
                T(4, 3) = T(4, 4)
                T(5, 3) = T(5, 4)
                Text7.Text = T(2, 2)
                Text12.Text = T(2, 3)
                Text13.Text = T(3, 3)
                Text14.Text = T(4, 3)
                Text15.Text = T(5, 3)
            End If
        End If
    Else
        n = V
        T(1, 1) = T(6, 1)
        ost1 = T(1, 4) - T(6, 1)
        Text1.Text = T(1, 1)
        If T(6, 2) >= ost1 Then
            T(1, 2) = ost1
            ost2 = T(6, 2) - ost1
            Text6.Text = T(1, 2)
            n = p
            If ost2 >= T(2, 4) Then
                T(2, 2) = T(2, 4)
                ost3 = ost2 - T(2, 4)
                Text7.Text = T(2, 2)
                n = p
                If ost3 >= T(3, 4) Then
                    T(3, 2) = T(3, 4)
                    ost4 = ost3 - T(3, 4)
                    Text8.Text = T(3, 2)
                    n = p
                    If ost4 >= T(4, 4) Then
                        T(4, 2) = T(4, 4)
                        ost5 = ost4 - T(4, 2)
                        Text9.Text = T(4, 2)
                        n = p
                        T(5, 2) = ost5
                        T(5, 3) = T(6, 3)
                        Text10.Text = T(5, 2)
                        Text15.Text = T(5, 3)
                    Else
                        T(4, 2) = ost4
                        Text9.Text = T(4, 2)
                        T(4, 3) = T(4, 4) - ost4
                        T(5, 3) = T(5, 4)
                        Text14.Text = T(4, 3)
                        Text15.Text = T(5, 3)
                    End If
                Else
                    T(3, 2) = ost3
                    Text8.Text = T(3, 2)
                    T(3, 3) = T(3, 4) - ost3
                    T(4, 3) = T(4, 4)
                    T(5, 3) = T(5, 4)
                    Text13.Text = T(3, 3)
                    Text14.Text = T(4, 3)
                    Text15.Text = T(5, 3)
                End If
            Else
                n = V
                T(2, 2) = ost2
                Text7.Text = T(2, 2)
                ost3 = T(2, 4) - T(2, 2)
                T(2, 3) = ost3
                T(3, 3) = T(3, 4)
                T(4, 3) = T(4, 4)
                T(5, 3) = T(5, 4)
                Text12.Text = T(2, 3)
                Text13.Text = T(3, 3)
                Text14.Text = T(4, 3)
                Text15.Text = T(5, 3)
            End If
        Else
            n = V
            T(1, 2) = T(6, 2)
            ost2 = ost1 - T(6, 2)
            T(1, 3) = ost2
            T(2, 3) = T(2, 4)
            T(3, 3) = T(3, 4)
            T(4, 3) = T(4, 4)
            T(5, 3) = T(5, 4)
            Text6.Text = T(1, 2)
            Text11.Text = T(1, 3)
            Text12.Text = T(2, 3)
            Text13.Text = T(3, 3)
            Text14.Text = T(4, 3)
            Text15.Text = T(5, 3)
            
        End If
    End If
End If

'Åñëè â êàêîé òî ÿ÷åéêè ìàòðèöû ïîëó÷èëñÿ íîëü,çàìåíÿåì åãî íà ïóñòîå ïîëå
If T(1, 1) = 0 Then
    Text1.Text = ""
Else
    Text1.Text = T(1, 1)
End If

    If T(2, 1) = 0 Then
        Text2.Text = ""
    Else
        Text2.Text = T(2, 1)
    End If
 
        If T(3, 1) = 0 Then
            Text3.Text = ""
        Else
            Text3.Text = T(3, 1)
        End If
  
            If T(4, 1) = 0 Then
                Text4.Text = ""
            Else
                Text4.Text = T(4, 1)
            End If

                If T(5, 1) = 0 Then
                    Text5.Text = ""
                Else
                    Text5.Text = T(5, 1)
                End If

                    If T(1, 2) = 0 Then
                        Text6.Text = ""
                    Else
                        Text6.Text = T(1, 2)
                    End If

                        If T(2, 2) = 0 Then
                            Text7.Text = ""
                        Else
                            Text7.Text = T(2, 2)
                        End If

                            If T(3, 2) = 0 Then
                                Text8.Text = ""
                            Else
                                Text8.Text = T(3, 2)
                            End If

                                If T(4, 2) = 0 Then
                                    Text9.Text = ""
                                Else
                                    Text9.Text = T(4, 2)
                                End If

                                    If T(5, 2) = 0 Then
                                        Text10.Text = ""
                                    Else
                                        Text10.Text = T(5, 2)
                                    End If

                                        If T(1, 3) = 0 Then
                                            Text11.Text = ""
                                        Else
                                            Text11.Text = T(1, 3)
                                        End If

                                            If T(2, 3) = 0 Then
                                                Text12.Text = ""
                                            Else
                                            Text12.Text = T(2, 3)
                                            End If

                                                If T(3, 3) = 0 Then
                                                    Text13.Text = ""
                                                Else
                                                    Text1.Text = T(3, 3)
                                                End If

                                                    If T(4, 3) = 0 Then
                                                        Text14.Text = ""
                                                    Else
                                                        Text14.Text = T(4, 3)
                                                    End If

                                                            If T(5, 3) = 0 Then
                                                                Text15.Text = ""
                                                            Else
                                                                Text15.Text = T(5, 3)
                                                            End If
                                                            
If Len(Text25.Text) > 1 Then
help_me.Visible = True
Text25.BackColor = &H80FF;&
End If

End Sub
Public Static Sub Error_clean()
help_me.Visible = False
about_err.Visible = False
Text25.BackColor = &HFFFFFF;
Text25.Text = ""
Text16.BackColor = &HFFFFFF;
Text17.BackColor = &HFFFFFF;
Text18.BackColor = &HFFFFFF;
Text19.BackColor = &HFFFFFF;
Text20.BackColor = &HFFFFFF;
Text21.BackColor = &HFFFFFF;
Text22.BackColor = &HFFFFFF;
Text23.BackColor = &HFFFFFF;
Text24.BackColor = &HFFFFFF;
End Sub

Public Static Sub Clear()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text22.Text = ""
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Call Error_clean
End Sub

Private Sub solve_it_Click()
Call Solve_Click
End Sub

Private Sub that_is_Click()
Load trzd
trzd.Show
End Sub

 

Revise this Paste

Your Name: Code Language: