 
                
                38 posts
                
             
            
                Posted 16 March 2017 - 12:15 AM
                I need to make a program where the user's input always adds a new line of code (string) to a file. But what I keep getting is each type the user writes a string into a file, the previous code/string is deleted. How do I continually keep adding strings to this one file without the previous code going to trash?
                
             
         
        
        
            
            
                
                     
                
                34 posts
                
             
            
                Posted 16 March 2017 - 12:22 AM
                you want to use
file = fs.open("file_path_here", "a")
"a" being the important part, this 
appends to the end of the file.
you can then use
file.writeLine("This line is now appended!")
to append to the end of the file.
Edited on 15 March 2017 - 11:22 PM
                
             
         
        
        
            
            
                
                     
                
                38 posts
                
             
            
                Posted 16 March 2017 - 12:47 AM
                you want to use
file = fs.open("file_path_here", "a")
"a" being the important part, this 
appends to the end of the file.
you can then use
file.writeLine("This line is now appended!")
to append to the end of the file.
Haha I didn't think of that, thanks. I guess I had trouble because I didn't know what append meant lmao
 
         
        
        
            
            
                
                     
                
                34 posts
                
             
            
                Posted 16 March 2017 - 02:37 PM
                You're welcome :)/>