Saving GUI inputs

Recommended Posts

Tobytja 0

Tobytja 0

when I want to put some variable to script, which's value is defined through GUICtrlCreateInput function, I can predefine the value by putting the appropriate text as the first function parameter. Can I somehow modify the parameter from the GUI? Like by creating a "save" button, which would rewrite the original function parameters inside of the script with the actual values in Input fields.

Link to post

Share on other sites

Tobytja 0

Tobytja 0

Which puts a word "Script" to the Input field, when the GUI is opened. After clicking on a button, script reads the value and starts. But if I modify the input value, the script doesn't remember it and next time the word "Script" appears there again.

Say that someone else wants to have "DeuBa Script" as a preset value. Now he must open the script for editing and manually rewrite the parameter from "Script" to "DeuBa Script" or rewrite the value in the Input field each time he opens the GUI. I'd like to find a way to edit the command inside of the script, without having to open it for editing, so that it inside of the script looks like this:

GLOBAL $Input3 = GUICtrlCreateInput("DeuBa Script", 134, 90, 209, 21)

Is there any way to do this?

Edited June 19, 2013 by Tobytja

Share this post

Link to post

Share on other sites

water 1,938

water 1,938

Something like this? It reads the value for the input control from a ini file. As soon as you press "Save" the current value is saved to the input file and will be displayed as soon as you restart the script.

Share this post

Link to post

Share on other sites

Tobytja 0

Tobytja 0

Can it be done without any additional file? It would be more "idiot-proof", since most of the people using the script have no IT skill, they are just "trained monkeys". That's the reason I'm looking for a way to simplify the way to change preset values in the first place. So it could easily happen, that they forget they need this file, delete it and then come crying "hey, why it doesn't work?"

Share this post

Link to post

Share on other sites

TheSaint 1,595

TheSaint 1,595

Obviously, if it finds no entry there, then it writes in the defaults ... which is what would happen if the program was run on another PC. An ini file is less intrusive though, and the program can also be set to recreate the ini with defaults if missing. Most users don't know about ini files and don't need to, as it should be an invisible interaction.

To do as you request, would mean having to change the code of a compiled script, and then recompile it each time, which is even more of a hassle than worrying about ini files. At least with the registry option, the program can be relocated at will anywhere on the same PC, and have no problem recalling stored values.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key?Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox(be advised many downloads are not working due to ISP screwup with my storage)