once more I'm doing something wrong

Useless to say that I'n new to Arduino.
I want to a call a function passing a parameter. Very simple but I don't understand how to access the parameter inside the function.
I wrote a simple sketch and I get a compile error. The simple question is: how do I get the parameter value in my function?
many thanks

void setup() {
  // put your setup code here, to run once:
  int parameter1 = 100;
  int parameter2 = 200;
  int value = 0;
}
void printroutine (value) {
  println (value);
  return;
}
void loop() {
  // put your main code here, to run repeatedly:
  printroutine (parameter1)
  delay (1000)
  printroutine (parameter2)
  delay (1000)
}

It's all about that scope.

The variables that you declare inside of your setup routine are only accessible inside of the setup routine.
As soon as you exit the setup routine, the variables are forgotten.

Instead, declare them outside the setup routine. You can still assign the values inside the setup routine.

Let us know how it works out for you.

int parameter1 = 100;  //global variables
int parameter2 = 200;

void setup()
{
  Serial.begin(115200);
  printroutine(parameter1);
  printroutine(parameter2);
}

void loop()
{
  // put your main code here, to run repeatedly:
  printroutine (parameter1);
  delay (1000);
  printroutine (parameter2);
  delay (1000);
  printroutine(1234);
  delay(1000);
}

void printroutine (int value)
{
  Serial.println (value);
}

Many many thanks! My major mistake was not to declare int the input parameter. I correct several other sintax problem and now this is working fine.

This forum is really of great help many thanks

 int parameter1 = 100;
  int parameter2 = 200;
  int value = 0;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
 }
void printroutine (int value) {
  Serial.println (value);
  return;
}
void loop() {
  // put your main code here, to run repeatedly:
  printroutine (parameter1);
  delay (1000);
  printroutine (parameter2);
  delay (1000);
}

Note that you don't need the return; at the end of your function as it will return automatically when it ends.

You would normally use return; if you want to return from the function before it ends and more specifically if you wanted to return a value, perhaps the result of a calculation, from the function.