Quote:
Originally Posted by fowlplay4
Here's some basic examples for the savestring and savelines functions.
PHP Code:
// Declare Filename
temp.filename = "path/to/file.txt";
// Save Lines
temp.lines = {
"Line 0: Hello",
"Line 1: World!"
"Line 2: How are you?"
};
temp.lines.savelines(temp.filename, 0);
// Save String
temp.str = "Hello World!\n";
temp.str.savestring(temp.filename, 0);
// Append String to File
temp.str = "Yeah!\n";
temp.str.savestring(temp.filename, 1);
// Append Lines to File
temp.lines.savelines(temp.filename, 1);
|
Yeah.. That's great and all, but there's still no solution to my original problem :s
My script loads a file from the server, displays it in a GUI, allows editing, but when it's saved, the new lines only show in the GUI and are not displayed in the original textfile, which could be a problem for things like guild text files, etc. If I could use the first thing shown (creating lines manually) I would, but that would destroy the use of the script all together.
I need to overwrite, not append the text files.
Lastly, what's being sent to the serverside part of the script to save the lines is the GUIs text.