Page 1 of 1

Autosave checkboxes

PostPosted: Fri Feb 09, 2018 5:33 pm
by Alberto FUL
I don't understand how (or If) checkboxes are saved upon exit.
Eventually how to retrieve them.

Re: Autosave checkboxes

PostPosted: Fri Feb 09, 2018 6:10 pm
by Battwell
you can write a macro that reads them and saves them to the profile- put this in your destructor macro when fully tested.

on startup re read the values in a constructor macro. re write them to screen if required
these are both in your macro folder. - but blank. highest macro numbers

i had to do this to save everything in my tool changer.

Re: Autosave checkboxes

PostPosted: Fri Feb 09, 2018 6:20 pm
by ger21
I do this in the constructor macro.

Code: Select all
string key20303 = exec.Readkey("UserCheckboxes", "20303", "False");
if (key20303=="True")
    {
      .............
      ............
    }

Re: Autosave checkboxes

PostPosted: Fri Feb 09, 2018 6:35 pm
by dezsoe
A short way in M99999 to save:
Code: Select all
exec.Writekey("YourSection", "YourKey", AS3.Getcheckboxstate(10000).ToString());

And in M99998 to load:
Code: Select all
AS3.Setcheckboxstate(Convert.ToBoolean(exec.Readkey("YourSection", "YourKey", "False")), 10000);

Re: Autosave checkboxes

PostPosted: Fri Feb 09, 2018 7:43 pm
by Alberto FUL
Thank You guys