Announcement

Collapse
No announcement yet.

Save xButton Properties in ini file

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

  • JSTX2013
    replied
    thank you for all!

    Leave a comment:


  • Cybergraph
    replied
    Originally posted by claus707 View Post
    I think that in the second script you should have something like this:
    Code:
    SetXbuttonenabled = INIFile.GetValue("AutoPlay\\Docs\\ButtonState3.ini", "ButtonState3", "SetXbuttonenabled");
    xButton.SetProperties("xButton3", {Enabled=SetXbuttonenabled});
    Because the variable SetXbuttonenabled has just this values true or false...
    INIFile.GetValue returns a string value, instead the 2nd parameter of function xButton.SetProperties needs a table value.

    Leave a comment:


  • claus707
    replied
    I think that in the second script you should have something like this:
    Code:
    SetXbuttonenabled = INIFile.GetValue("AutoPlay\\Docs\\ButtonState3.ini", "ButtonState3", "SetXbuttonenabled");
    xButton.SetProperties("xButton3", {Enabled=SetXbuttonenabled});
    Because the variable SetXbuttonenabled has just this values true or false...

    Leave a comment:


  • JSTX2013
    started a topic Save xButton Properties in ini file

    Save xButton Properties in ini file

    Hello.

    i want to Save xButton Properties in '".ini file" and then load but after Saved and Load Script in "on Preload" have Error :

    Argument 2 must be of type table.

    Script for Save in xbutton Properties :


    Code:
    ButtonState3 = xButton.GetProperties("xButton3");
    if xButton.GetProperties("xButton3").Enabled then
    INIFile.SetValue("AutoPlay\\Docs\\ButtonState3.ini", "ButtonState3", "SetXbuttonenabled", "true");
    else
    INIFile.SetValue("AutoPlay\\Docs\\ButtonState3.ini", "ButtonState3", "SetXbuttonenabled", "false");
    end
    Script for load "on Preload":

    Code:
    SetXbuttonenabled = INIFile.GetValue("AutoPlay\\Docs\\ButtonState3.ini", "ButtonState3", "SetXbuttonenabled");
    xButton.SetProperties("xButton3", SetXbuttonenabled);

    can anybody tell me what wrong ?
Working...
X