Adafuit V2 Motor sketch won't compile

I’ve used the Adafruit stepper motor sketch and added the stepper motor knob sketch along with some conditional statements. There are strays which I believe are issues with punctuation and a constructor, destructor, or type conversion before ‘/’ token issue when I try to compile this code.

Any help or insights in pointing me to a clearer understanding of input and output designations specifically how to deal with steps which I have made a global call out. I’ve downloaded the Arduino programming notbook which has helped me with the math parts of the code

#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x60);
// Connect two stepper motors with 200 steps per revolution (1.8 degree)
// to motor port #1 (M1 and M2)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myMotor1 = AFMS.getStepper(200, 1);
Adafruit_StepperMotor *myMotor2 = AFMS.getStepper(200, 2);
int potinPin = (A0);
int stepsPin = 2;
int previous = 0;
int val = 0;
int potinValue = 0;
int stepsValue = 0;

void setup() {
  Serial.begin(9600);
  // set up Serial library at 9600 bps
  AFMS.begin();  // create with the default frequency 1.6KHz
  //AFMS.begin (1000)  // OR with a different frequency, say 1KHz

  myMotor1->setSpeed(10);  // 10 rpm
  myMotor2->setSpeed(10);  // 10 rpm
}

void loop() {
  potinValue = analogRead(potinPin);
  previous = map(potinValue, 0, 1023, 0, 544);
  delay (500);
  potinValue = analogRead(potinPin);     // Reads potentiometer assigns new value
  val = map(potinValue, 0, 1023, 0, 544);

  // conditional statements determining movement and direction
  if (val == previous) { // no potentiometer movement no stepper movement either
  }
  else if ( val > previous) {
    stepsValue = (val - previous);
    myMotor1->step((stepsValue), FORWARD, MICROSTEPS);
    myMotor2->step((stepsValue), FORWARD, MICROSTEPS);
  }
    if else  (val < previous) {
    stepsValue = (previous - val);
    myMotor1->step((stepsValue), BACKWARD, MICROSTEPS);
    myMotor2->step((stepsValue), BACKWARD, MICROSTEPS);
  }
}
*/  <<<<<<<<<< This looks out of place.  Try removing it.

#include <Wire.h>
#include <Adafruit_MotorShield.h>
...

I agree and I took them out. I thought that a global variable (potin) could be named two different loop variables as long as they are separated by time. Now I am not so sure. I don't think the software/processor likes it.

Additionally does the software treat an equation that has both subtraction and multiplication in the order that it is written or does it follow the rules/order of mathematics? I ask because of the double bracket scenario is a little sticky.

Lithium3: ...

Additionally does the software treat an equation that has both subtraction and multiplication in the order that it is written or does it follow the rules/order of mathematics? I ask because of the double bracket scenario is a little sticky.

It follows the mathematics rules... If you find a programming language that doesn't follow mathematical rules, disregard it as being trash!

Thank you for the math order clarification evil. I took the easy way out and mapped the two variables to eliminate the factor and the double bracket math induced mess. I still have two errors when compiling this sketch but I'm constantly learning and I'm getting much closer because of your and Coding Badly''s insights.

Thank you both.

Thank you for all of you're help and support. You're suggestions have helped me to fix most of the issues and help me to think of a better solution which I have re-coded above. I just need to make one final edit and the sketch compiles correctly. Thanks again for all of your time and insights.