This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
robotTX's profile picture

Why don't working this program?

Started by robotTX, 19 November 2017 - 07:23 PM
robotTX #1
Posted 19 November 2017 - 08:23 PM
folder =MyFolder
FileName =MyFile

if fs.exists(folder/FileName) then
print("Worked!")
else
print("Not worked! :(/>")
end
KingofGamesYami #2
Posted 19 November 2017 - 10:09 PM
1. You have to use strings (MyFolder refers to a variable, "MyFolder" is a string).
2. Strings or nil variables can't be divided (a/b is division)
3. Strings can be combined ("Hello" .. "World" -> "HelloWorld")*
4. However, in this case it's probably better to use fs.combine.

*Note that -> is not actual code, this is just to indicate the result of combining the two strings.
Lupus590 #3
Posted 19 November 2017 - 10:13 PM
http://www.computerc...ask-a-pro-post/
Edited on 19 November 2017 - 09:14 PM