Reading current value on a PWM pin

Is there a way to read from within a sketch as to what the current value is on a pwm pin? the following is the scenario

I set a pwm value from a variable and the variable gets reset. Now is there a way(some register?) where i can read the values from?

Cheers,
Pracas

For the '168 / '328 processors...

OCR1A
OCR1B

OCR2A
OCR2B

Or introduce a variable lastvalue [if memory permits]