Problems using constructor and distructor to save current...

I've some problems to save and read the current tool value. Here is the code in constructor macro,
and here the code in desrtuctor macro.
When set current tool in UCCNC and then close it, in the .pro file i have the value of the set current tool. But when i start UCCNC the value of the current tool is 0. Am'i missing something. Thanks
- Code: Select all
exec.Setcurrenttool (Convert.ToInt32 (exec.Readkey ("MyCNC", "CurrentTool", "False")));
and here the code in desrtuctor macro.
- Code: Select all
exec.Writekey ("MyCNC", "CurrentTool", Convert.ToString(exec.Getcurrenttool ()));
When set current tool in UCCNC and then close it, in the .pro file i have the value of the set current tool. But when i start UCCNC the value of the current tool is 0. Am'i missing something. Thanks