>>In my function I got the message missing parameters
>>
>>Then I looked into another function I saw the parameters:
>>
>>*****************************************************************
>>LPARAMETERS tcSource, tcDestination, tcAction, tlUserCanceled
>>*****************************************************************
>>
>>What are parameters ?
>>Are they variables ?
>>
>>Could anybody explain ? because I never used them before
>>
>>Moises
>
>A function or procedure is a bit of code that can be called over and over again, to do some specific task. (FUNCTION and PROCEDURE is the same in VFP.)
>
>A function might require some data to work with. This data is passed through parameters.
>
>Here is a sample function that calculates the volume of a sphere. As data, it requires the radius of the sphere. I am also including a command that calls (or invokes) the function.
>
>
>* Function is called here.
>* The number 3 is passed as a parameter, i.e., as data to the function.
>* The return value of the function is shown on screen - it might
>* also be assigned to a variable, or included in further calculations.
>? SphereVolume(3)
>
>function SphereVolume(tnRadius)
> return 4 / 3 * pi() * tnRadius ^ 3
>endfunc
>
>* Alternative syntax:
>* function SphereVolume
>* lparameters tnRadius
>* return 4/ 3 * pi() * tnRadius ^ 3
>* endfunc
>
>
>In the example:
>
3 is passed as a parameter.
>The function receives this to the variable tnRadius.
>The function does some calculations with this value.
>The function returns a value.
>The entire function call can be used in more complex expressions, for example: x = SphereVolume(lnRadius) * 10 to get the volume of 10 identical spheres. When using a function this way, the function is evaluated, and the resulting value (the value returned by the function) is replaced in the expression.
Here is the link I mentioned earlier http://www.berezniker.com/display/VFP/Difference+between+FUNCTION+and+PROCEDURE+statements
If it's not broken, fix it until it is.
My Blog