Jump to content




[Lua] [Error] <eof> expected

lua help

6 replies to this topic

#1 Masoman3

  • New Members
  • 5 posts

Posted 08 July 2012 - 04:14 AM

Just some background first:
I was messing around with the rednet stuff, creating linked computers that would send and receive info, the basic idea was to see if I could get a main computer to send a message to multiple computers, triggering the receiving one to send back a message, of whether or not there was a current flowing into a selected side. As such, there was two separate bits of code, and I will post both. I also tried to get it to display to a monitor, using a startup program that called [ shell.run("monitor", "top", "startup_prog")]. However, I could run it both ways.

The Error:
When I try to run the program, I get an error that says:

[bios:206: [string "startup_prog"]:77: '<eof>' expected]

I believe that <eof> is the end of file marker, and to fix this I tried opening the actual file in about 3 different programs, namely notepad and notepad++. However, it gave me another error saying there was an unexpected symbol on line 77.

Help?

Main server code:
Attached File  startup_prog-main.txt   1.97K   344 downloads

Client code:
Attached File  startup_prog-client.txt   971bytes   116 downloads

#2 ardera

  • Members
  • 502 posts
  • LocationGermany

Posted 08 July 2012 - 04:52 AM

View PostMasoman3, on 08 July 2012 - 04:14 AM, said:

I believe that <eof> is the end of file marker
<eof> is not end of File!
its needed for else's and elseif's that are not needed... Example:
if ok then
  print("ok")
end
else
  print("not ok")
end

PS.: The error said: string["startup_prog"] so what program is the right? startup_prog-main or startup_prog-client?

#3 Masoman3

  • New Members
  • 5 posts

Posted 08 July 2012 - 05:05 AM

The client code works fine, the main server one is the one showing the error. Also, end of file is just what I remembered from some c++ tutorials, with reading in files.

#4 ardera

  • Members
  • 502 posts
  • LocationGermany

Posted 08 July 2012 - 05:15 AM

You had one end to much, here is the corrected code, i think it will work:
(i dont know how to upload attachments, so here is the code:)
Spoiler


#5 Masoman3

  • New Members
  • 5 posts

Posted 08 July 2012 - 05:40 AM

Thankyou, Its working now. BTW, did you like the idea?

#6 ardera

  • Members
  • 502 posts
  • LocationGermany

Posted 08 July 2012 - 08:12 AM

if you mean the program: don't know what it's for but look good.

#7 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,436 posts

Posted 08 July 2012 - 07:45 PM

View Postardera, on 08 July 2012 - 04:52 AM, said:

View PostMasoman3, on 08 July 2012 - 04:14 AM, said:

I believe that <eof> is the end of file marker
<eof> is not end of File!
its needed for else's and elseif's that are not needed... Example:
if ok then
  print("ok")
end
else
  print("not ok")
end

PS.: The error said: string["startup_prog"] so what program is the right? startup_prog-main or startup_prog-client?

<eof> absolutely is the end-of-file marker.

This error code is a symptom of having extra 'end' statements. Also, what are you trying to show in your example? There are too many end statements there too.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users