INSTRUCTING ARDUINO TO RECALL A PREVIOUSLY GIVEN VALUE

int var;

void function()
{
    var = 42;
}

void setup(){}
void loop(){}

whats the issue? post code

i would like my function to change the meaning of the variable 'distance'

variables are just values, meanings of that value is what you hold in your head... post code