傳回 Double,指定資產在單一期間內的直線折舊。
命名空間: Microsoft.VisualBasic
組件: Microsoft.VisualBasic (在 microsoft.visualbasic.dll 中)
語法
'宣告
Public Shared Function SLN ( _
Cost As Double, _
Salvage As Double, _
Life As Double _
) As Double
'用途
Dim Cost As Double
Dim Salvage As Double
Dim Life As Double
Dim returnValue As Double
returnValue = Financial.SLN(Cost, Salvage, Life)
public static double SLN (
double Cost,
double Salvage,
double Life
)
public:
static double SLN (
double Cost,
double Salvage,
double Life
)
public static double SLN (
double Cost,
double Salvage,
double Life
)
public static function SLN (
Cost : double,
Salvage : double,
Life : double
) : double
參數
- Cost
必要項。Double,指定資產的初始成本。
- Salvage
必要項。Double,指定資產在可用期末的價值。
- Life
必要項。Double,指定資產的可用期間長度。
傳回值
傳回 Double,指定資產在單一期間內的直線折舊。
備註
如需詳細資訊,請參閱 Visual Basic 的主題 SLN 函式。
折舊期間必須使用與 Life 引數相同的單位來表示。所有引數都必須為正數。
範例
此範例使用 SLN 函式傳回資產在單一期間內的直線折舊,其條件是有給定資產的初始成本 (InitCost)、資產有效期末的殘值 (SalvageVal) 以及資產的有效總年數 (LifeTime)。
Dim InitCost, SalvageVal, LifeTime, DepYear As Double
Dim Fmt As String = "###,##0.00"
InitCost = CDbl(InputBox("What's the initial cost of the asset?"))
SalvageVal = CDbl(InputBox("Enter the asset's value at end of its life."))
LifeTime = CDbl(InputBox("What's the asset's useful life in years?"))
' Use the SLN function to calculate the deprecation per year.
Dim SlnDepr As Double = SLN(InitCost, SalvageVal, LifeTime)
Dim msg As String = "The depreciation per year: " & Format(SlnDepr, Fmt)
msg &= vbCrLf & "Year" & vbTab & "Linear" & vbTab & "Doubling" & vbCrLf
' Use the SYD and DDB functions to calculate the deprecation for each year.
For DepYear = 1 To LifeTime
msg &= DepYear & vbTab & _
Format(SYD(InitCost, SalvageVal, LifeTime, DepYear), Fmt) & vbTab & _
Format(DDB(InitCost, SalvageVal, LifeTime, DepYear), Fmt) & vbCrLf
Next
MsgBox(msg)
平台
Windows 98、 Windows 2000 SP4、 Windows CE、 Windows Millennium Edition、 Windows Mobile for Pocket PC、 Windows Mobile for Smartphone、 Windows Server 2003、 Windows XP Media Center Edition、 Windows XP Professional x64 Edition、 Windows XP SP2、 Windows XP Starter Edition
.NET Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱系統需求一節的內容。
版本資訊
.NET Framework
支援版本:2.0、1.1、1.0
.NET Compact Framework
支援版本:2.0、1.0
請參閱
參考
Financial 類別
Financial 成員
Microsoft.VisualBasic 命名空間
ArgumentException