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

I made a whoopsydoodles!

Started by applesauce10189, 05 May 2014 - 06:31 AM
applesauce10189 #1
Posted 05 May 2014 - 08:31 AM
I made a whoopsydoodles and have no clue what's wrong but here's my code. Well. I think it's a spelling error that I can't find. Attempt to call nil on line 52




function fMerge(file1, file2)
  local hf = fs.open(file1, "r")
  local m1 = hf.readAll()
  hf.close()
  local mf = fs.open(file2, "r")
  local m2 = mf.readAll()
  mf.close()
  cf = m1.." "..m2
  mf.open(file1, "w") --Line 52
  hs.write(cf)
  mf.close()
end

By the way, if it's something painfully obvious that would make you question if I even know how to use a keyboard, in my defense, I'm incredibly tired atm.
theoriginalbit #2
Posted 05 May 2014 - 08:33 AM
mf = fs.open(file1, "w")
but then I could also ask where hs.write(cf) is coming from too…
Edited on 05 May 2014 - 06:34 AM
applesauce10189 #3
Posted 05 May 2014 - 08:53 AM
mf = fs.open(file1, "w")
but then I could also ask where hs.write(cf) is coming from too…
Thx, before posting it I actually had quite a few spelling derps. I probably shouldn't code when low on sleep…