Michael Halvorson, on page 284 of the referenced text, gives the following example of a procedure in a standard module to hold a function declaration.
To wit:
Function Rate (Hits, Attempts) As String
Percent = Hits / Attempts
Rate = Format(Percent, "0.0%"
End Function
On the next page, at the end of the fourth line, he states: "The Hits argument and Attempts argument are placeholders for the two variables that will be passed to the function during the function call."
Later on page 284 (step 13), he enters the following statment as the last line in a Command1_Click event procedure.
lblRate.Caption = Rate(Wins, Spins) which are public variables and populated in other program code.
I am thoroughly confused as to why he uses the Hits and Attempts argument in the Rate Function. Nowhere does he populate these variables in the illustration of the function procedure.
Any help would be greatly appreciated.
JWJ
James W. Jozwiak
jjozwiak1052@earthlink.net
To wit:
Function Rate (Hits, Attempts) As String
Percent = Hits / Attempts
Rate = Format(Percent, "0.0%"
End Function
On the next page, at the end of the fourth line, he states: "The Hits argument and Attempts argument are placeholders for the two variables that will be passed to the function during the function call."
Later on page 284 (step 13), he enters the following statment as the last line in a Command1_Click event procedure.
lblRate.Caption = Rate(Wins, Spins) which are public variables and populated in other program code.
I am thoroughly confused as to why he uses the Hits and Attempts argument in the Rate Function. Nowhere does he populate these variables in the illustration of the function procedure.
Any help would be greatly appreciated.
JWJ
James W. Jozwiak
jjozwiak1052@earthlink.net