Reading the position of a flex sensor to set a limit

Been Hacking trying to make this work, I'm hung up on the context of assigning and using integers. At startup I want to read the value of the current position of the flex sensor and use that as a start point. After that the flex sensor will be moved straight again and if flexed to that value or beyond then the buzzer should start. If you want to set a new position then set the flex sensor where you want the limit to be and then press the button and the new parameter is set. This code is hacked as you can see I know I'm just missing something simple.. The value in this hacked code is hard set to 100 but thats what I want to make the stored integer.

int flexSensorPin = A0;//analog pin 7= tiny2=A1
// int StartValue = flexSensorPin;
const int Piezo = 3; //digital pin 3 = tiny0
const int inPin = 2; // Push Button to set current Bend Status
void setup() {
  pinMode (Piezo, OUTPUT);
  pinMode(inPin, INPUT);    // declare pushbutton as input
  Serial.begin(9600);
}
void loop() {
  int val = 0;
  val = digitalRead(inPin)
        ;  int flexSensorReading = analogRead(flexSensorPin);
  Serial.println(flexSensorReading);
//  if inPin( HIGH goto Start; 
  if (flexSensorReading < 100) {
    Serial.println("Alarm! Set Angle Exceeded");
    digitalWrite(Piezo, HIGH);
    if(digitalRead(inPin)){
//    LoggedPosition=flexSensorReading;
}
    delay(100);
    digitalWrite(Piezo, LOW);

  }
  delay(250);
}