Repeating servo actions using EEPROM

I'm having some trouble making two servo's robot whose movement I can record into EEPROM. I picked a project where you could record and playback one servo's movement and tried making the same thing with two servos but I lack the knowledge on how to do so.
I'm using Arduino mega R3 2560.

Here's a link to a project I referred to:

Here's my code:

#include <Servo.h>
#include <EEPROM.h>//used to store recorded values
Servo Servo1;
Servo Servo2;



int led = 9;   ///

float resolution = 2000;//MUST be less than EEPROM.length()
float recordTime = 5; //delay time
bool recording = false;

void setup() {
 pinMode(13, OUTPUT); //status led

pinMode(4, OUTPUT);
 digitalWrite(4, HIGH);

 pinMode(2, OUTPUT);
 digitalWrite(2, HIGH);
 
 Servo1.attach(3);
 Servo2.attach(5);
 
 Serial.begin(9600);

 //Serial.println(EEPROM.length());
}

void loop() {
 if (recording == true) {//record
   for (int i = 1; i <= resolution; i++) & (int a = 1; a <= resolution; a++){
     digitalWrite(led, 100); //light status led
     int val = map(analogRead(A0), 0, 1023, 0, 180);
      int vbl = map(analogRead(A1), 0, 1023, 0, 180);
     EEPROM.write(i, val) & (a, vbl);

     //Serial.println(EEPROM.read(i));
     Servo1.write(vbl);
     Servo1.write(val);
     delay(recordTime);
   }
   digitalWrite(led, LOW); //turn off status led
   delay(1000);//give time for person
   recording = false;
 }
 else {
   for (int i = 1; i <= resolution; i++) & (int a = 1; a <= resolution; a++) {//playback
     if (digitalRead(2) == 0) {//stop playback and record new values
       recording = true;
       break;
     }
     int readval = EEPROM.read(i);
     int readvbl = EEPROM.read(a);
     Servo1.write(readval);
     Servo2.write(readvbl);
     //Serial.println(readval);
     delay(recordTime);
   }
   digitalWrite(led, 100); //show a new repeat
   delay(100);
   digitalWrite(led, LOW);
 }
}

Here's my error message:

Arduino: 1.8.13 (Mac OS X), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

/Users/sleiniai/Documents/Arduino/sketch_jul17d/sketch_jul17d.ino: In function 'void loop()':
sketch_jul17d:33:45: error: expected primary-expression before 'int'
    for (int i = 1; i <= resolution; i++) & (int a = 1; a <= resolution; a++){
                                             ^~~
sketch_jul17d:33:45: error: expected ')' before 'int'
sketch_jul17d:33:56: error: 'a' was not declared in this scope
    for (int i = 1; i <= resolution; i++) & (int a = 1; a <= resolution; a++){
                                                        ^
sketch_jul17d:49:45: error: expected primary-expression before 'int'
    for (int i = 1; i <= resolution; i++) & (int a = 1; a <= resolution; a++) {//playback
                                             ^~~
sketch_jul17d:49:45: error: expected ')' before 'int'
sketch_jul17d:49:56: error: 'a' was not declared in this scope
    for (int i = 1; i <= resolution; i++) & (int a = 1; a <= resolution; a++) {//playback
                                                        ^
Multiple libraries were found for "Servo.h"
Used: /Users/sleiniai/Documents/Arduino/libraries/Servo
Not used: /Applications/Arduino.app/Contents/Java/libraries/Servo
exit status 1
expected primary-expression before 'int'


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Here is the code which I relied on:

#include <Servo.h>
#include <EEPROM.h>//used to store recorded values

Servo myServo;

float resolution = 1000;//MUST be less than EEPROM.length() (check serial monitor)
float recordTime = 5; //delay time
bool recording = false;

void setup() {
  pinMode(13, OUTPUT); //status led
  pinMode(2, OUTPUT);
  myServo.attach(3);

  Serial.begin(9600);
  digitalWrite(2, HIGH);
  //Serial.println(EEPROM.length());
}

void loop() {
  if (recording == true) {//record
    for (int i = 1; i <= resolution; i++) {
      digitalWrite(13, HIGH); //light status led
      int val = map(analogRead(A0), 0, 1023, 0, 180);

      EEPROM.write(i, val);
      //Serial.println(EEPROM.read(i));
      myServo.write(val);
      delay(recordTime);
    }

    digitalWrite(13, LOW); //turn off status led
    delay(1000);//give time for person
    recording = false;
  }
  else {
    for (int i = 1; i <= resolution; i++) {//playback
      if (digitalRead(2) == 0) {//stop playback and record new values
        recording = true;
        break;
      }
      int readval = EEPROM.read(i);
      myServo.write(readval);
      //Serial.println(readval);
      delay(recordTime);
    }

    digitalWrite(13, HIGH); //show a new repeat
    delay(100);
    digitalWrite(13, LOW);
  }
}

You can't mess with the syntax of the for loop like that and expect it to work. For both record and playback you need 2 for loops, one for each servo.

Steve

Thanks, I'll have that in mind.