DefSng A-Z
Dim a(10), b(10), c(10), pc
----------------------------------------------------------------
Private Sub Command1_Click()
pc = pc + 1
a(pc) = Text1.Text
b(pc) = Text2.Text
c(pc) = Text3.Text
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
End Sub
----------------------------------------------------------------
Private Sub Command2_Click()
Dim d(10), e(10), f(10), g(10)
For i = 1 To pc - 1
For j = i + 1 To pc
If a(i) > a(j) Then
tmp = a(i): a(i) = a(j): a(j) = tmp
tmp = b(i): b(i) = b(j): b(j) = tmp
tmp = c(i): c(i) = c(j): c(j) = tmp
End If
Next j
Next i
For i = 1 To pc
d(i) = c(i) - b(i)
e(i) = 2000
f(i) = d(i) * 50
g(i) = 2000 + f(i)
total = total + g(i)
Next
Form1.Hide
Form2.Show
Form2.Print "사용자번호", "전월 검침량", "금월 검침량", "사용량", "기본료", "사용금액", "납부금액"
For i = 1 To pc
Form2.Print a(i), b(i), c(i), d(i), e(i), f(i), g(i)
Next
Form2.Print "납부액 총계"; total
End Sub