Remember Input Settings

 

Hi!

 

I have a script with a set of inputs, and the #property show_inputs;

 

Now each time I run the script, I can set the inputs as I like, however the next time I run the script the inputs are set back to default.

 

Is there any way to tell the script to "remember" the last input settings and use these for the next run?

 

Thanks!

 

Richard 

 
The only way is to compile the script with those input settings as the default options.
 
Pity! ;/ Ok thanks for the feedback!
 
knave, one thing I was thinking on this idea, but IDK if it is possible.  Would it be possible to put code in the script to both save the settings to an external file, and if the script is run, to check to see if that file exists, and to load the settings if it does?
 
JD4:
knave, one thing I was thinking on this idea, but IDK if it is possible.  Would it be possible to put code in the script to both save the settings to an external file, and if the script is run, to check to see if that file exists, and to load the settings if it does?

Yep, could work. Didn't think of that. Good call.

 

Personally, I'd just code the defaults how I want them. If necessary, have multiple instances of the script with different defaults and hotkeys.

Or have a dropdown list in the inputs which preselects the necessary options. 

 
honest_knave:

Yep, could work. Didn't think of that. Good call.

 

Personally, I'd just code the defaults how I want them. If necessary, have multiple instances of the script with different defaults and hotkeys.

Or have a dropdown list in the inputs which preselects the necessary options. 

That is true as well.  But I think that this could be used if they feel the need to tweak a little for long term, instead of having to go back and recode the script itself.  Could leave the rest of the code alone, and just tweak on the settings, and have them saved automatically.  Your way if you knew the settings you wanted ahead of time.
 
Please do not feed the troll. When you respond, you give the troll power. When you ignore the troll, he starves for attention and eventually dies.
 

Thanks for the feedback all!

 

I worked around this issue by having another script "Configure Settings" to set Global Variables of the settings the user chooses. I needed to be flexible with the option because the user I give the script to can't necessarily go into the mql4 and change the code. JD$'s solution is also a good idea - will give it a try when I can!

 

Thanks

 

Richard 

 
WHRoeder:
Please do not feed the troll. When you respond, you give the troll power. When you ignore the troll, he starves for attention and eventually dies.

Since I have a strong feeling you are talking about me, allow me to respond in kind.


It has been repeatedly mentioned (by me and others) about how your responses to many people on this site are not as smooth as they could be.  Multiple times suggestions were made to help you help decrease those misunderstandings that have apparently happened because you seem unable to comprehend sometimes that people are not necessarily at the same programming skill level as you, and possibly do not use English as much, and might not understand your explanation fully.  Despite those efforts, you seem to have not been able to grasp the concept.  So, as soon as you get that concept locked down perfectly (and show you have by your posts), then you can feel free to try to correct others in this way.  Until then, remember an important saying, those that live in glass houses shouldn't throw stones.  And before you get an attitude about me correcting you on this, I try to be polite in my posts.  I occasionally am not in response to what I see others doing.  But I have not once told you you were telling someone a program tip wrong.  My issue is with the wording on a doc page.

Reason: