Announcement

Collapse
No announcement yet.

save button settings for use later

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • save button settings for use later

    I hv some bottons that let me change the values of some variables (eg, on/off) when I press them. I would like to hv an efs that will save the variable settings whenever I press the buttons (eg, by saving the last values to a file). So that when I reload the chart again, the chart will try to read the file first to restore the latest button values.

    Would someone pls show me how to do so? thx.

  • #2
    Richard,

    The basic steps associated with writing and reading files is contained in an efs I helped put together here. http://forum.esignalcentral.com/show...=&postid=78487. It is a bit more complex than you need, as it is written to save multiple lines and read however many that are in the file, but it has all the basics, and I believe it will help you out.

    A couple things. The file will be contained in the "C:\Program Files\eSignal\FormulaOutput" path. Also, when you read data from a file, it is read as a string, so if you have a number, it must be converted from a string when reading from a file. However, when saving numbers, they do not have to be converted to strings prior to saving them to the file. I prefer to save data to a file from an array. That way, the values are automatically comma delimited in the file line.

    Another item to consider is when to save your data to the file. I recommend that you save the file in the post Main section. This ensures that all changes made during the efs session are recorded to the file upon exiting, as this function is run automatically just prior to exiting the efs.

    function postMain() {
    }


    I hope this will help.

    Comment

    Working...
    X