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

Line thinks it is nil

Started by Creeper9207, 08 April 2015 - 08:22 PM
Creeper9207 #1
Posted 08 April 2015 - 10:27 PM
http://pastebin.com/g6tweGV9 - full code
erroring line 8:
local newdata = data:match(":"..":"..file2..":"..":(/>.+);".."/;"..file2..";"..";"):gsub("=n".."32", " \ ".."n")
thinks its nil.
function activator:
setFileData("nu","nu,","hi")
other note: "nu" is the file's name

i put data in the ::nu::;/;nu;; section, now it just doesnt return anything
Bomb Bloke #2
Posted 08 April 2015 - 10:40 PM
What's with the excessive quotes?

local newdata = data:match("::"..file2.."::(.+);/;"..file2..";;"):gsub("=n32", " \ n")

What does it "think is nil"? Are you saying that's what newdata ends up being set to, or…? Where's a sample of "data"?
Edited on 08 April 2015 - 08:41 PM
Creeper9207 #3
Posted 08 April 2015 - 10:47 PM
fixed it

and to awnser, im escaping special chars
Bomb Bloke #4
Posted 08 April 2015 - 10:55 PM
… no you're not?

But that's a good point, that last one should probably be either "\n" or " \\ n". Not sure what you were going for.
Edited on 08 April 2015 - 08:58 PM
Creeper9207 #5
Posted 08 April 2015 - 11:17 PM
=n32, :: ;/; and ;; are special chars
MKlegoman357 #6
Posted 09 April 2015 - 12:38 PM
Concatenating strings doesn't escape anything. And in what context are those characters special?
Bomb Bloke #7
Posted 09 April 2015 - 12:48 PM
In his context.

He's saying he's dividing them up because he wants to.