アットウィキロゴ

30 世代会計

Function gou(rou, tu, iz) As Single
Dim g1 As Single
Dim year As Single
g1 = 0
For year = 0 To 199
g1 = g1 + tu(year) + rou(year) + iz(year)
Next
gou = g1
End Function
Private Sub Command1_Click()
Dim ystart As Single
Dim a1 As Single
Dim a2 As Single
Dim rou(0 To 199) As Single
Dim tu(0 To 199) As Single
Dim iz(0 To 199) As Single
Dim rev(0 To 199) As Single
Open "c:/simple/gdata/世代通算年金受給額.txt" For Input As #1
Do Until EOF(1)
Input #1, a1, a2
ystart = a1
tu(ystart) = a2
Loop
Close #1
Open "c:/simple/gdata/世代遺族年金受給額.txt" For Input As #2
Do Until EOF(2)
Input #2, a1, a2
ystart = a1
iz(ystart) = a2
Loop
Close #2
Open "c:/simple/gdata/世代老齢年金受給額.txt" For Input As #3
Do Until EOF(3)
Input #3, a1, a2
ystart = a1
rou(ystart) = a2
Loop
Close #3
Open "c:/simple/gdata/世代支払保険料.txt" For Input As #4
Do Until EOF(4)
Input #4, a1, a2
ystart = a1
rev(ystart) = a2
Loop
Close #4
Open "c:/simple/gdata/世代会計.txt" For Output As #44
For ystart = 0 To 199
Write #44, ystart, rev(ystart), tu(ystart) + rou(ystart) + iz(ystart)
Next
Close #44
For ystart = 0 To 199
Debug.Print ystart, rev(ystart), tu(ystart) + rou(ystart) + iz(ystart)
Next
Debug.Print gou(rou, tu, iz)
End Sub
最終更新:2009年03月02日 00:16