Show that once on SerialPrint

Good morning, sir,
I'd like you to help me with the code if you can.
I'd like "Program Stat..."

Serial.println("Program start...");

which is displayed once the button is activated or displayed once on the serial monitor but not in a loop.
Thanks

// this constant won't change:
const int buttonPin = 2; // the pin that the pushbutton is attached to

const int doorAPin = 3; // the pin that the pushbutton is attached to
const int doorBPin = 4; //

const int ledPinbutton = 7; // the pin that the LED is attached to

const int ledPindoorA = 8; //
const int ledPindoorB = 9; //


// Variables will change:

int buttonState = 0; // current state of the button
int lastButtonState = 0; // previous state of the button

int DeviceState = 0; // current state of DEVICE

int buttonPushCounter = 0; // counter for the number of button presses

int Operation = 0; //

int doorAState = 0;         // current state of the Door A
int doorBState = 0;         // current state of the Door B

int lastdoorAState = 0;     // previous state of the Door A
int lastdoorBState = 0;     // previous state of the Door B

void setup() {
  // initialize the button pin as a input:
  pinMode(buttonPin, INPUT);
  // initialize the door pin as a input:
  pinMode(doorAPin, INPUT);
  // initialize the LED as an output:
  pinMode(doorBPin, INPUT);
  
  // initialize the LED as an output:
  pinMode(ledPinbutton, OUTPUT);
  // initialize the LED as an output:
  pinMode(ledPindoorA, OUTPUT);
   // initialize the LED as an output:
  pinMode(ledPindoorB, OUTPUT);
  
  // initialize serial communication:
  Serial.begin(9600);
        
  Serial.println( " Starting the program: Hello ... ");
  Serial.println(" ");
 
} //void setup

void loop() {
  
  // read the pushbutton input pin:
  buttonState = digitalRead(buttonPin);

  // compare the buttonState to its previous state
  if (buttonState != lastButtonState) {
    
    // save the current state as the last state, for next time through the loop
    lastButtonState = buttonState;
    
    // if the state has changed, increment the counter
    if (buttonState == HIGH) {
      // if the current state is HIGH then the button went from off to on:
      buttonPushCounter++;
    
     } //if (buttonState == HIGH)
   } //if (buttonState != lastButtonState)
  
 
  // First Press  
      if (buttonPushCounter % 2 == 1) {
        
        //turn LED BUTTON ON:
        digitalWrite(ledPinbutton, HIGH);
        //
        Serial.println("Program start...");
        
		// DOOR A **************************************
         // read the pushbutton input pin:
    	 doorAState = digitalRead(doorAPin);
      		// compare the DoorState to its previous state
      		if (doorAState != lastdoorAState) {
   
        		if (doorAState == LOW) {// if the door A is Open
      				// turn LED DOOR A ON:
					digitalWrite(ledPindoorA, HIGH);   
     
         		} //if (doorState == LOW)

         		else { // door A is closed
      	 	
           			// turn LED DOOR A OFF:
 					digitalWrite(ledPindoorA, LOW); 
             
         		} //else

     		}//if (doorAState != lastdoorAState)
        
         // save the current state as the last state, for next time through the loop
     	 lastdoorAState = doorAState;
    	// *********************************************
        
        // DOOR B **************************************
         // read the pushbutton input pin:
    	 doorBState = digitalRead(doorBPin);
  
      		// compare the DoorState to its previous state
      		if (doorBState != lastdoorBState) {
       
        		if (doorBState == LOW) {// if the door A is Open
        			// turn LED DOOR B ON:
 					digitalWrite(ledPindoorB, HIGH); 
         
        		} //if (doorState == LOW)

         		else { // door B is closed
      	 			// turn LED DOOR B OFF:
 					digitalWrite(ledPindoorB, LOW); 
          
         			} //else

      		}//if (doorBState != lastdoorBState)
  
         // save the current state as the last state, for next time through the loop
      	 lastdoorBState = doorBState;
        // *********************************************      
       
      } // if (buttonPushCounter % 2 == 1)
    
   // Second Press  
   if (buttonPushCounter % 2 == 0) { 
     
       // turn LED BUTTON OFF:
       digitalWrite(ledPinbutton, LOW);
       // turn LED DOOR A OFF:
       digitalWrite(ledPindoorA, LOW);
       // turn LED DOOR B OFF:
       digitalWrite(ledPindoorB, LOW);
       // 
       
     } //(buttonPushCounter % 2 == 0)

 
 delay(10);
        
} //void loop

Capture d’écran 2020-05-28 à 16.44.38.png

I'm sorry, I don't understand your question. Can you elaborate/reformulate?

if you want to do something once, either you put it in the setup(), or you need to remember that you already took the action. you create a global Boolean variable and change its value once you take the action.

bool actionAlreadyDone = false;
...

void loop()
{
  ...
  if (button is pressed) {
    if (! actionAlreadyDone) {
      Serial.println("Program start...");
      actionAlreadyDone = true;
    }
  ...
}

TimMJN:
I'm sorry, I don't understand your question. Can you elaborate/reformulate?

I wanted to display "Programe Start" one time in the serial Monitor. thank you

J-M-L:
if you want to do something once, either you put it in the setup(), or you need to remember that you already took the action. you create a global Boolean variable and change its value once you take the action.

bool actionAlreadyDone = false;

...

void loop()
{
  ...
  if (button is pressed) {
    if (! actionAlreadyDone) {
      Serial.println("Program start...");
      actionAlreadyDone = true;
    }
  ...
}

Thank you. I've tried it works very well.

Why not just do it at the end of the setup()??

SteveMann:
Why not just do it at the end of the setup()??

because the program really starts on a button press I suppose

Then why not put a while(!buttonPressed) at the end of setup() ..?

Well then you end up with a program stuck in the setup, you might want to do other things in the loop() while waiting for that button press to activate a part of the program.

Also seems OP will read that button many times during the normal course of operations to take actions, so it's not a bad idea to keep it in the loop. it does cost 1 byte of RAM though. I assume this is for debugging purpose and that this will go away later so no big deal