# Undefined var - no idea why!

**URL:** https://forum.kirupa.com/t/undefined-var-no-idea-why/256079
**Category:** Uncategorized
**Created:** [March 30, 2008, 1:06pm UTC](https://forum.kirupa.com/t/undefined-var-no-idea-why/256079 "2008-03-30T13:06:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![billy\_talent](https://avatars.discourse-cdn.com/v4/letter/b/bb73d2/32.png) [@billy\_talent](https://forum.kirupa.com/u/billy_talent)
#### Post date: [March 30, 2008, 1:06pm UTC](https://forum.kirupa.com/t/undefined-var-no-idea-why/256079/1 "2008-03-30T13:06:53Z")

</div>

hey guys, I am having problems working out the difference between two numbers… here is the code that I am using:

```auto

var rawDifference:Number;
var minuteDifference:Number;
function calculateMinuteDifference() 
   {
   rawDifference = currentMinute - recentMinute2;
      if (rawDifference < 0)
      {
         minuteDifference = 60 + rawDifference;
      }
      else if (rawDifference > 0)
      {
         minuteDifference = rawDifference;
      }
}

```

and the output i get is:

```auto
   //The Raw Difference is: undefined
   //The Difference in Minutes: undefined

```

does anybody have any idea why this might be happening?  
thanks in advance 🙂
