Page 1 of 1

plugins - storing variables within uccnc

PostPosted: Wed Sep 14, 2016 4:48 pm
by Robertspark
Hello,

with the Contour Shuttle Xpress plugin that I attempted (its a little rough!), I use the streamwriter and streamreader class within c# to store the settings for the various buttons on the contour shuttle xpress.

Is there a way that these settings can be store these values within the uccnc without resorting to a text file to saving and recalling these settings.

Thanks very much

(no rush on any explanations or guidance, I'm doing other things (other than plugins) at present)

Re: plugins - storing variables within uccnc

PostPosted: Wed Sep 14, 2016 6:24 pm
by Robertspark
Ahhhh!

[having a lot of epiphanies this evening!]

Function: string Readkey(string section, string key, string defaultvalue)
Description: This function reads a key value from the profile (.pro) file. The section and the key parameter defines which key to read from the profile file and the function returns with the defaultvalue parameter if the key does not exist in the profile file. The function returns a string type.
Example: string mykeyvalue = exec.Readkey("axessettingscontrolX", "Axisenabled", "False");

Function: void Writekey(string section, string key, string value)
Description: This function writes a key value into the profile (.pro) file. The section, and the key parameter defines which key to write to the profile file. The value parameter is the new value to write. If the key already exists in the profile file then the function overwrites the key with the new value. If the key does not exist then the function creates the key in the file with the set value.
Example: exec.Writekey("axessettingscontrolX", "Axisenabled", "False");