Code:
interestRate = ApproxRate(Periods, Payment, loan)
now the variable interestRate holds the value that was return from the ApproxRate function..
The parameters in the function (stuff in the parentheses --->ApproxRate(Periods, Payment, loan) ) are the values that you declared before:
Code:
Dim loan As Double = "175 000.00"
Dim periods As Integer = "60" 'months'
Dim interestRate As Double 'value to retrieve'
Dim payment As Double = "3941.59"
if you wouldve instead done this:
Code:
Dim loany As Double = "175 000.00"
Dim fiveYearPeriod As Integer = "60" 'months'
Dim interestRate As Double 'value to retrieve'
Dim giveUpMoney As Double = "3941.59"
then you wouldve called the function like this:
Code:
ApproxRate(fiveYearPeriod, giveUpMoney, loany)
but you need to use or assign the value the function returns like this:
Code:
interestRate = ApproxRate(fiveYearPeriod, giveUpMoney, loany)
So the function will get those value, execute the code inside of the function and return a value of type Double...
Functions always give you a value back.. So you have to use or assign that value to something..
Subs just execute some code to make something happen..
You can google datatype, function, and Sub for vb.net....