问题描述
Dim futureValue As Decimal = Me.CalculateFutureValue(monthlyInvestment,annualInterestRate,years)
Dim futureValue As Decimal = Me.CalculateFutureValue(monthlyInvestment,yearlyInterestRate, years)
推荐答案
子和函数都是子程序,或者是程序中可以调用的代码段。它们之间的区别在于函数具有返回值而子函数没有。
A sub and a function are both subroutines, or sections of code that can be called in the program. The difference between them is that a function has a return value and a sub does not.
参考: []
单击计算按钮时会触发btnCalculate_Click事件并在该事件内使用参数和返回值调用的函数(CalculateFutureValue)将分配给
refer: Difference between Private Sub, Function and Class[^]
when you click calculate button it will fire the btnCalculate_Click event and inside that event your function(CalculateFutureValue) called with parameters and returned value will assign to
Dim futureValue As Decimal = Me.CalculateFutureValue(monthlyInvestment,yearlyInterestRate, years)
这篇关于在此代码块中调用“CalculateFutureValue”子程序的子例程或标记是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!