millis() and global variables

I am relatively new to Arduino. I have an Arduino Mega board and I seem to have a strange bug with calling millis() or global variables from within C++ methods. I first started seeing the problem when I called millis() from a class method and the value appeared to be random (much larger than the value seen in the loop() function. So I then tried writing millis() to a global ulong and accessing the global from my class method...I was still getting garbage. Here is an example of what I was trying...any clues? In the example below the two sets of prints do not match?!?!

File Test.pde: . . . unsigned long CurrMS; TestPrint TstPR;

loop () { CurrMS = millis(); Serial.print("curr="); Serial.println(CurrMS); TstPr.print(); };

TestPrint.h: exten unsigned long CurrMS; class TestPrint { public: TestPrint(){}; void print(){Serial.print("curr="); Serial.println(CurrMS);}; }

exten unsigned long CurrMS;

Did this really compile?

I retyped my code above, so there were typos:) The actual code did compile.

So why didn’t you post what you compiled?