IR remote resender problem

My tv remote was lost so I got the ir code from the receiver datasheet…
So I have the little radio remote. I’m trying to receive the radio remote code if true send the new cod 1 time only but the problem is that it send the new code without stopping. how can I make it send one time only…

The Arduino code:

#include <IRremote.h>

IRsend irsend;
int RECV_PIN = 12;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()

void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
if(results.value==0xFFA25D) {
irsend.sendSony(0x80BF3BC4, 12);


 if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value

This is ALL that you do when a new code arrives. From then on, you keep sending the code that you got this time. Why?

You are ignoring previous requests to use code tags. Why?
Please read these two posts:

How to use this forum - please read.
Read this before posting a programming question …

You have posted code without using code tags. The code tags make the code look

like this

when posting source code files. It makes it easier to read, and can be copied with a single mouse click. Also, if you don’t do it, some of the character sequences in the code can be misinterpred by the forum code as italics or funny emoticons.
If you have already posted without using code tags, open your message and select “modify” from the pull down menu labelled, “More”, at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the “</>” icon at the upper left hand corner. Click on the “Save” button. Code tags can also be inserted manually in the forum text using the code and /code metatags.