Sorry I don't think I'm being very clear. Your right a global variable can be updated. However, It seems that my definition of 'distance' is only valid during the function in which it is defined. In the second function I would like to find a way to recall/remember this variable.
the following quotation is taken from the Function Declaration page on the Arduino site:
"Segmenting code into functions allows a programmer to create modular pieces of code that perform a defined task and then return to the area of code from which the function was "called"."
Source: http://arduino.cc/en/Reference/FunctionDeclaration
i would like my function to change the meaning of the variable 'distance'. I would like the variable 'distance' to take effect on other functions. I hope this helps.
best, Arthur