Quick help with EEPROM.read()

//____________Defining global variables________________________________________
    boolean pType = 0; //Choose BAR = false /psi = true =!0

//____________Reading values from eeprom_______________________________________
 pType = EEPROM.read(0);

void saveSettings()
      if (flagChanges = 1) //Only save if necassary!
            EEPROM.write(0,pType); //Pressure units
             lcd.setCursor(2, 1); // set the cursor to column 3, line 0                          
             lcd.print("NO CHANGES MADE!");
             lcd.setCursor(4, 2); // set the cursor to column 3, line 0                          
             lcd.print("EXITING MENU");
             menu.moveUp(); //EXIT up one level   

Causes error message

expected constructor, destructor, or type conversion before '=' token

I can't figure out what's causing this.

If you post your whole code we can reproduce the feature.

I assume pType = EEPROM.read(0); is causing the error as it is done outside a function ...

Had to attach it as zip.
It is too big for the forum… but, you are right. I need to put it inside “void setup()”

Menu_0_0_2_8_lcd.zip (7.18 KB)

 if (flagChanges = 1) //Only save if necassary!

is not the same as

 if (flagChanges == 1) //Only save if necassary!