Here's a code example that only works with PARAMETERS in the first function called:
Code:
functionABC(123)
function functionABC()
parameters p1
return functionXYZ()
function functionXYZ()
return p1+1
It is no sensible use case, but functionB can only access p1, if it's received from functionA as a PRIVATE parameter and not as a LOCAL parameter.
So the use case would be a function that is the interface to the outside world using further functions internally, which all work on the initially passed in parameters without needing to pass them on and on and on, as all further functions can access what the entry point function received in the first place.
It could make complex partially recursive functions faster as you only have one time parameter passing in and can work with that on all recursion levels.
That said, recursion usually is a bit of a devil and you better find an iterative or otherwise nonrecursive solution instead. Also, even when using recursion you often will pass on a changed value to the next recursion level and rarely are interested in the values passed in to the entry level of the recursion.
You could find non-recursive scenarios in which splitting up the functionality into several functions (or prgs) makes sense and you would use one of them as entry point to receive private parameters for the whole family of prgs.
Well, and obviously you find no difference of bahavour after the code ran, both local and private parameters or vars are released when the function that created them ends and returns. PRIVATE isn't the same as receiving parameters by ref vs by value, too, so you don't redecalare an outside variable as a private variable, just because you receive parameters into a private parameter variable.
There also is only one reason for this alternative to LPARAMETERS: IF you'd want to guarantee your private function variable isn't overriding an already existing private variable defined outside and previously, you would need to specify PRIVATE varname to state that your code will now claim its own right on that name and won't influence that previously exiting variable. But you can't put a PRIVATE statement before a PARAMETER or LPARAMETER statement, they have to be the first line in the code. So without the existence of PARAMETERS you could not first specify that you want to use this private variable name for yourself and then receive the passed in value into it. With PARAMETERS you can and will do both at the same time.
This also makes PARAMETERS the only actual declaration of private variables. PRIVATE on its own does not declare a variable, PARAMETERS does, because it will also make the variable names exist and be of value .F. if no parameter is passed in and PCOUNT() is 0 or lower than the number of parameters.
Chriss