I am trying to make a part in my system that will update when you get past a password protection and after that will copy the program file on a floppy and replace the one currently running, but i cannot get passed the error of startup:185: expected string, string
I understand what the startup:185: is I am giving the segment of the code that I am trying to get happen.
I need it to take the input given by the user and put it in this.
fs.copy("disk/[Userinput Here!]", "startup")
I tried doing it this way.
fs.copy([["disk/]]..input..[[", "startup]])
that does not work with this one.
fs.copy([["disk/]]..input..[[", "startup") Does not work?
Started by SNWLeader, Jan 20 2013 01:51 PM
3 replies to this topic
#1
Posted 20 January 2013 - 01:51 PM
#2
Posted 20 January 2013 - 01:53 PM
fs.copy( "disk/"..input, "startup" )
you had a few misplaced " in the first one
and the second one... well.... [[ ]] dont work in that way...
Edited by TheOriginalBIT, 20 January 2013 - 01:53 PM.
#3
Posted 20 January 2013 - 02:25 PM
Yep that worked just nicely. Thanks.
#4
Posted 20 January 2013 - 02:32 PM
SNWLeader, on 20 January 2013 - 02:25 PM, said:
Yep that worked just nicely. Thanks. 
Just as a note:
common usage of [[ ]] is to have a string formatted exactly as it is provided... for example
local handle = fs.open( filePath, "w" ) handle.write([[ This would write the following text into the file exactly how it appears here. Optionally some other data can be added by doing this ]]..someData..[[ That is all :)/> ]]) handle.close()
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











