Private Sub reshenie_Click() Dim Mas%(), i%, j% Dim needYear As Integer, iMoney As Single, CountMoney As Single Open CurDir$ & "\predpr.dat" For Random As #1 Len = Len(pr) kolzap = LOF(1) \ Len(pr) fg.Clear fg.Cols = 13: fg.Rows = 16 For i = 1 To kolzap Get #1, , pr needYear = CInt(InputBox("Введите год")) If (needYear >= CInt(pr.nachalo)) And (needYear <= CInt(pr.konec)) Then iMoney = pr.pl(needYear - CInt(pr.nachalo) + 1) CountMoney = CountMoney + iMoney End If fg.TextMatrix(i, 0) = pr.name Next i Close #1 Text2.Text = CStr(CountMoney) End Sub |