This is always a hot topic at this time of year. It’s been a while since we did procedures, parameters, byVal, Byref & Data Flow
From Shawlands Acc
- Data flow within a program is handled by parameters
- A parameter is a value or a variable which is passed into or out from a subroutine
- The parameters used in a procedure call are ACTUAL parameters
- The parameters used in a procedure definition are called FORMAL parameters
- A parameter is passed BY REFERENCE if it is to by passed into and back out of a procedure
- A parameter is passed BY VALUE if it is to by passed into but NOT back out of a procedure
- Arrays are ALWAYS passed by reference
- The use of parameters means that variables can be kept local to subroutines
- This leads to programs being more reliable and robust