macro "constrain" passed 5 arguments, but just takes 3

I am new to Arduino. I am using 1.8.9. I am using an Arduino Mega. I am trying to write a program for a robotic finger and I am getting this error message:

Youtube_Sensor_Glove:22:111: error: macro “constrain” passed 5 arguments, but takes just 3

Servoposition1 = constrain(indexposition, min servo range, max servo range, min sensor range, max sensor range);

^

exit status 1
macro “constrain” passed 5 arguments, but takes just 3

Here is the code

In the top left hand corner it says Youtube_Sensor_Glove

For some reason

#include <servo.h>

Servo index1;

Const int flexpin1;

Void setup()
{
index1.attach(9);
}

Void loop()
{
Int flexposition1;
Int indexposition1;

Flexposition1 = analogread(flexpin1);
Servoposition1 = map(flexposition1, min servo range, max servo range, min sensor range, max sensor range);

Servoposition1 = constrain(indexposition, min servo range, max servo range, min sensor range, max sensor range);

index1.write(indexposition1);

delay(50);
}

}

void != Void.

How many arguments does constrain() take? See constrain

Please read How to use this forum - please read., specifically point #7 about posting code.

Perhaps you meant to use map()?

You often need to wrap a map() with a constrain() because map() is unconstrained.

What on earth do you expect constrain() to do with 5 arguments?

the rest of your code is also a mess.

void is spelled with a lower case v (only reason this hasn't been called out is that the preprocessor is choking before it even starts compiling, because constrain() is a macro, not a function).

You would also get an error because indexposition isn't declared - presumably you meant indexposition1, except you never assigned a value to it, so it has a random value (global variables are initialized to 0 even if not explicitly initialized, but local variables are not automatically initialized, so they'll have whatever value happened to be at that memory location) - so it wouldn't make sense as the first argument to constrain. Or map for that matter.

So what do I need to do to fix the code in its entirety?

Correct the spelling of "void", "const", "Servo" and declare something called "Servoposition1". Decide whether you want constrain or map. And code tags.