Const unsigned long - Read-only Variable.. Why? (SOLVED)

Hi,

I´m trying to set open-time for a valve, but there seems to be a lil problem. I can set time by giving a number value like this:

const unsigned long DrainValvePeriod = 300000;  //Set Drain Valve Open Time

But if i use an variable (int) instead of a number, the code gives an error: "DrainValvePeriod"-variable is "read-only".

So this doesn´t work:

const unsigned long DrainValvePeriod = DrainTimeOutputValue;  //Set Drain Valve Open Time

What should I use instead of "const unsigned long"? Or is there some other way to solve this problem? Help? Anyone?

Thanks.

,Tomi

The const keyword makes it read only. So just get rid of the const.

Big Thanks Metallor. Problem solved.

,Tomi

const = constant. Which means you promise never to change it. The compiler is just holding you to your promise.

Steve