# Compare the same data at the same frame

**URL:** https://discourse.processing.org/t/compare-the-same-data-at-the-same-frame/26987
**Category:** Coding Questions
**Created:** [January 11, 2021, 9:16pm UTC](https://discourse.processing.org/t/compare-the-same-data-at-the-same-frame/26987 "2021-01-11T21:16:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bking](https://avatars.discourse-cdn.com/v4/letter/b/dc4da7/32.png) [@bking](https://discourse.processing.org/u/bking)
#### Post date: [January 11, 2021, 9:16pm UTC](https://discourse.processing.org/t/compare-the-same-data-at-the-same-frame/26987/1 "2021-01-11T21:16:24Z")

</div>

Hello!

I don’t understand why my program record the same value whereas it shouldn’t?

I want to record 3 different datas with 1 different frame each time one of my three value is different.  
I think, I compare datas not in a good manner.

Here my fonction record

```auto
void record() {

// to STOP record touch @

    if (key == '@'){
    output.flush();
    output.close();
    exit();
          } // if formerCoupling is different but the key and keyCode is the same, output it
  else if (((formerCoupling != coupling)) ||
       
       (((formerKey == int (key)) ||
       (formerKeyCode == int (keyCode))))){
       
         output.println(frameCount + ":" + (int)key + ":" + (int)keyCode + ":" + int (coupling*1000));
      }
      
 // if the tree value are different output them 
        else if (((formerCoupling != coupling)) &&
       
       (((formerKey != int (key)) ||
       (formerKeyCode != int (keyCode))))){   
   output.println(frameCount + ":" + (int)key + ":" + (int)keyCode + ":" + int (coupling*1000));
      }
     // if the value keyCode is different output them 

      else if (((formerCoupling == coupling)) &&
       
       (((formerKey == int (key)) ||
       (formerKeyCode != int (keyCode))))){
        
        
       output.println(frameCount + ":" + (int)key + ":" + (int)keyCode + ":" + int (coupling*1000));
    }   
     // if the value key is different output them 
     else if (((formerCoupling == coupling)) &&
       
       (((formerKey != int (key)) ||
       (formerKeyCode == int (keyCode))))){
        
        
       output.println(frameCount + ":" + (int)key + ":" + (int)keyCode + ":" + int (coupling*1000));
    }   
    
  }

```

for exemple i have those datas

```auto
121:35:18:-2375
121:102:70:-2375

```

Here you can see that last data int (coupling\*1000) is twice the same 😣
