Announcement

Collapse
No announcement yet.

Pleassse helpp :( Just one minute from your time

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

  • Imagine Programming
    replied
    Originally posted by ItzMagdy View Post
    Bffffff,, please, sry for that , i mean i want to save the properties of the input as an application value or anything when the user clicks the (SAVE) Button, and when he close the program, and open it again the on preload/show command that load the input properties on the input like it's bold or not, italic or not, size, color, the command fire up when he open the program
    Yes I know what you're asking for, see my initial response. You have to iterate through the properties table and save each pair if you want to use Application.SaveValue. Then when you load it, you have to determine which keys to load yourself or use the Registry functions to enumerate the keys.

    That's why I said that maybe using an INI file is more flexible. You can then just store the keys to a file and later enumerate all the keys in a section.

    Leave a comment:


  • ItzMagdy
    replied
    Bffffff,, please, sry for that , i mean i want to save the properties of the input as an application value or anything when the user clicks the (SAVE) Button, and when he close the program, and open it again the on preload/show command that load the input properties on the input like it's bold or not, italic or not, size, color, the command fire up when he open the program

    Leave a comment:


  • Imagine Programming
    replied
    What do you mean how to load it? How do you save it?

    Leave a comment:


  • ItzMagdy
    replied
    Originally posted by Imagine Programming View Post
    The result of Input.GetProperties is a table, however Application.SaveValue expects a string as value. There are several ways you could do this:

    - Store every single key in the properties table separately
    - Serialize the table into some format of string (json / xml) and save that result
    - Don't use Application.SaveValue, but the INIFile functions to create a config file. Application.SaveValue uses the registry

    You cannot simply save 'cac' with Application.SaveValue, 'cac' is a table containing a lot of values:
    Code:
    Debug.ShowWindow();
    for key, value in pairs(cac) do
    Debug.Print(tostring(key).." = "..tostring(value).."\r\n");
    end
    How to load it?

    Leave a comment:


  • Imagine Programming
    replied
    The result of Input.GetProperties is a table, however Application.SaveValue expects a string as value. There are several ways you could do this:

    - Store every single key in the properties table separately
    - Serialize the table into some format of string (json / xml) and save that result
    - Don't use Application.SaveValue, but the INIFile functions to create a config file. Application.SaveValue uses the registry

    You cannot simply save 'cac' with Application.SaveValue, 'cac' is a table containing a lot of values:
    Code:
    Debug.ShowWindow();
    for key, value in pairs(cac) do 
      Debug.Print(tostring(key).." = "..tostring(value).."\r\n");
    end

    Leave a comment:


  • ItzMagdy
    started a topic Pleassse helpp :( Just one minute from your time

    Pleassse helpp :( Just one minute from your time

    I made a kinda notepad that you can change the font properties, i finished coding that when you click save the application save the text on the input as a value and load it even if you closed the app, but i need to save the input props as a value , i tried several codes but didn't work idk how there it is

    On Click (Button1)
    Code:
    -- save input props
    cac = Input.GetProperties("Input1")
    tProperties = Application.SaveValue("tProperties", "tProps", cac);
    On Preload
    Code:
     -- load input props
    props = Application.LoadValue("tProperties", "tProps");
    if (Application.GetLastError() == 0) then
     Input.SetProperties("Input1", props)
     end
Working...
X