01-11-2011 11:07 AM
Hi
I am using a system checkbox on my frontpanel and I would like to know how I can set the default value of this control programmatically.
I have in mind for the user to tick or untick the control during run time and that the next time the program starts it 'remembers/reads' the last setting the user used. I can of course write it to a file but I imagine that it would be easier to set the default value of the control but I can not seem to find how to do so. Am I missing something?
Many thanks for your time and suggestions!
Jack
01-11-2011 11:19 AM
Yes, you're missing something.
The default value is included in your executable.
Thus the executable has to modify itself to store the "new" default value.
Best regards,
Balze
01-11-2011 11:32 AM
Hi
Thanks for the quick reply Balze. Thought I was overlooking something...then again I would have thought it useful for a VI or exe to have a 'log' included within itself that could be used to 'read' and store the last 'preferences' that a user wanted to set/remember for next time (ie select with a property node or similar') rather then writing and reading in a separate log file?
Thanks again and interested to hear further suggestions and work-arounds.
Jack
01-11-2011 11:44 AM
For things like this, you usually use an ini file and when you exit the program, you write the current value to that tag in the ini file. Then next time you run it, you read that tag and set the controls value
01-11-2011 11:52 AM
@for(imstuck) wrote:
For things like this, you usually use an ini file and when you exit the program, you write the current value to that tag in the ini file. Then next time you run it, you read that tag and set the controls value
Nothing to add !
01-11-2011 01:09 PM
Take a look at this thread.