if, else if comparing values

Hi everyone, new here and new to programming as well.

Basically I have a load cell, arduino is reading data, if it's > 1 gram, it sends a message.
Let's say i put 200 grams, it takes the measurement and sends the message. That works fine, but I want it to send a single message if the value is the same across certain time (hence the same weight is still on), but of course if I change the weight to less/more grams send the current weight, again only once.

From my understanding it needs to compare it's self continuously, but only execute one single command.
I used intergers to make the readings more stable, and I don't need the precision of float etc.
Think that's ok?
Maybe I got it all wrong here.
If someone could point me in the right direction it would be great, Thank you!
This is what I have so far:

 int weight;
 int oldweight;


void loop() {

 weight = (scale.get_units(10));    //get the value in grams from the load cell

if (weight > oldweight)

   {

    delay(800);
    SendMessage();
    Serial.println("weight > oldweight"); 

   }

     else if (weight == oldweight);

    {
       Serial.println("weight == oldweight");

    }


   weight=oldweight;

remove the ; on the end of

  else if (weight == oldweight);

it will terminate the if()

     else if (weight == oldweight);

The semicolon ends the if statement, so it does nothing.

Thanks guys, but still the same?

Is there any other way I could approach this problem?

  weight=oldweight;Looks the wrong way round to me as oldweight will never change

UKHeliBob:
  weight=oldweight;Looks the wrong way round to me as oldweight will never change

Came back to say I figured it out, but you've beat me to it.

Yes that is correct just swap oldweight = weight.

Thank you guy's for the help, I would still be struggling if it wasn't for people like you!

3d0:
Basically I have a load cell, arduino is reading data, if it's > 1 gram, it sends a message.
Let's say i put 200 grams, it takes the measurement and sends the message. That works fine, but I want it to send a single message if the value is the same across certain time (hence the same weight is still on), but of course if I change the weight to less/more grams send the current weight, again only once.

if the weight is different now to the last time i read it, then
reset the clock
make a note of what the weight is now
make a note of the fact that I have not yet sent a message about this weight
otherwise, if I have already sent a message about this weight
do nothing
otherwise, if the clock has not yet run out
do nothing
otherwise
send out a message about the weight
make a note of the fact that I have sent a message about this weight