Jump to content




I made a whoopsydoodles!


  • You cannot reply to this topic
2 replies to this topic

#1 applesauce10189

  • Members
  • 162 posts

Posted 05 May 2014 - 07: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.

#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 05 May 2014 - 07:33 AM

mf = fs.open(file1, "w")
but then I could also ask where hs.write(cf) is coming from too...

Edited by theoriginalbit, 05 May 2014 - 07:34 AM.


#3 applesauce10189

  • Members
  • 162 posts

Posted 05 May 2014 - 07:53 AM

View Posttheoriginalbit, on 05 May 2014 - 07:33 AM, said:

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...





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users