Announcement

Collapse
No announcement yet.

How To : Scintilla Object Save To Text File

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

  • How To : Scintilla Object Save To Text File

    Hello my friends.
    Firstly; I'm sorry for my bad english.

    As the title says; how to save text to a text file from a Scintilla object?
    I left a sample file in the appendix. Could you make the corrected version of the following file?

    Sincerely yours..
    Attached Files

  • #2
    Put this Code in Your Button :

    [HTML]Text = LuaScriptEditor.GetText(Handle);
    br = Dialog.FileBrowse(false, "Locate Save File", _DesktopFolder, "All Files (*.txt)|*.txt|", "save", "txt", false, true);
    if br[1] ~= "CANCEL" then
    TextFile.WriteFromString(br[1], Text, false);
    end
    Dialog.Message("Completed", "save completed successfully", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);[/HTML]

    Comment


    • #3
      Originally posted by sidiamur View Post
      Put this Code in Your Button :

      [HTML]Text = LuaScriptEditor.GetText(Handle);
      br = Dialog.FileBrowse(false, "Locate Save File", _DesktopFolder, "All Files (*.txt)|*.txt|", "save", "txt", false, true);
      if br[1] ~= "CANCEL" then
      TextFile.WriteFromString(br[1], Text, false);
      end
      Dialog.Message("Completed", "save completed successfully", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);[/HTML]
      Thank you so musch the best friend

      Comment


      • #4
        I have one more question;
        How exactly can we reverse this process?
        E.g; How do I load a * .txt file with "Open the File"?

        Comment


        • #5
          you can used this code :

          Code:
          fileb = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "lua", false, false);
          if (fileb[1]~="CANCEL") then
              textfile = TextFile.ReadToString(fileb[1]);
              LuaScriptEditor.ClearAll(Handle);
              LuaScriptEditor.AddText(Handle, textfile);
          end

          Comment


          • #6
            Originally posted by sidiamur View Post
            you can used this code :

            Code:
            fileb = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "lua", false, false);
            if (fileb[1]~="CANCEL") then
            textfile = TextFile.ReadToString(fileb[1]);
            LuaScriptEditor.ClearAll(Handle);
            LuaScriptEditor.AddText(Handle, textfile);
            end
            Thank you very much for your help.

            Comment

            Working...
            X