 
                
                15 posts
                
             
            
                Posted 13 September 2016 - 10:48 AM
                I'm really new and just made a simple program which is only 2 lines:
delete *
end
And this is what I get when I run it: bios.lua:14:  [string ". temp"]:1:   '=' expected
                
                    Edited on 15 September 2016 - 06:51 AM
                
             
         
        
        
            
            
                
                     
                
                756 posts
                
             
            
                Posted 13 September 2016 - 05:37 PM
                The computercraft wiki has a neat tutorial on how to write Lua code, here 
http://www.computerc.../wiki/TutorialsWhat you wrote is not Lua code.
If your intent was to run "delete *" as a shell command, then you must use a specific function, "shell.run"
So your code should look like
shell.run("delete *")
No 
end keyword needed.
Edited on 13 September 2016 - 03:45 PM
                
             
         
        
        
            
            
                
                     
                
                15 posts
                
             
            
                Posted 14 September 2016 - 08:24 AM
                Thanks!
                
             
         
        
        
            
            
                
                     
                
                259 posts
                
             
            
                Posted 14 September 2016 - 11:00 PM
                Or you could use the fs API.  fs.delete(path).  Either one is one line of code.
                
             
         
        
        
            
            
                
                     
                
                756 posts
                
             
            
                Posted 15 September 2016 - 02:20 AM
                fs.delete does not support the "*" wildcard, you'd have to make your own iterator that goes thru all of your files.