|
-
Mar 28th, 2000, 05:14 AM
#1
Thread Starter
New Member
hi everyone,
im having a problem with a procedure in a program im working on.the code looks like this:
Private Sub ShowDepSchedule(item As String, cost As Single, purchYear As Integer, numYears As Integer, depType As Single)
Dim depreciation As Single, straightLineDep As Single
Dim totalDeprec As Single, value As Single, yr As Integer
picOutput.Cls
picoutpur.Font = "courier new"
Call ShowHeading(item, cost, purchYear, numYears, depType)
Let value = cost
If depType = 1 Then Let straightLineDep = (1 / numYears) * value
Let totalDeprec = 0
For yr = 1 To numYears
If yr <> numYears Then
If depType = 1 Then
Let depreciation = straightLineDep
Else
Let depreciation = 2 / (numYears * value)
Else
Let depreciation = value
End If
Let totalDeprec = (totalDeprec + depreciation)
Call ShowYr(purchYear + yr - 1, value, depreciation, totalDeprec)
Let value = (value - depreciation)
Next yr
End Sub
anyways, i keep getting an else without if error. if anyone can help i would really appreciate it.
thanks, meth
-
Mar 28th, 2000, 05:22 AM
#2
Gudday Meth,
Insert an "End If" statement after the lines
Else
Let depreciation = 2 / (numYears * value)
and before the lines
Else
Let depreciation = value
End If
Thereby ending up with
If yr <> numYears Then
If depType = 1 Then
Let depreciation = straightLineDep
Else
Let depreciation = 2 / (numYears * value)
End If
Else
Let depreciation = value
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|