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

Edit startup issue

Started by ryarsh, 08 November 2012 - 06:30 PM
ryarsh #1
Posted 08 November 2012 - 07:30 PM
when i goto edit startup and just simply type

print("hello")
end

then reboot it gives me a error… anyone know why
the exact error is bios:206: [string "startup"]:2: '<eof>' expected..
Goof #2
Posted 08 November 2012 - 07:37 PM
Eof, means that you have an "end" too much. Only while, for, if statements needs an end, when the statement should end… Just simply remove your end, then youre done :-) edit: and functions also needs an end.
ryarsh #3
Posted 08 November 2012 - 07:40 PM
thanks, i didnt know that :P/>/>
cheekycharlie101 #4
Posted 08 November 2012 - 07:46 PM
when i goto edit startup and just simply type

print("hello")
end

then reboot it gives me a error… anyone know why
the exact error is bios:206: [string "startup"]:2: '<eof>' expected..
that is simple. you dont need an end. the end ends the following things:


if statments.
functions.
for loops.
while loops.

if you dont have any of these in your code then you dont need a loop.
just add

print("Hello")
and it should work fine.
there may be more things that a end is used for but there the ones i could think of.
thanks -cheeky
Luanub #5
Posted 08 November 2012 - 08:41 PM
Eof, means that you have an "end" too much. Only while, for, if statements needs an end, when the statement should end… Just simply remove your end, then youre done :-)

EOF actually mean its reach an unexpected End Of File(EOF). This can be caused by to many ends, but can also be caused by other errors as well. I have seen missing parentheses and a couple other things cause an EOF error.
Sammich Lord #6
Posted 09 November 2012 - 06:54 AM
Eof, means that you have an "end" too much. Only while, for, if statements needs an end, when the statement should end… Just simply remove your end, then youre done :-)

EOF actually mean its reach an unexpected End Of File(EOF). This can be caused by to many ends, but can also be caused by other errors as well. I have seen missing parentheses and a couple other things cause an EOF error.
Hate to be a grammar nazi but, you spelled "too" wrong.
digpoe #7
Posted 09 November 2012 - 06:58 AM
Usually <EOF> errors mean too many ends or too little ends, so if you had a function like this:

function test(arg1, arg2)
if arg1 then
print(arg2)
end
end
end

test(true, "Hello, world!")
it would error with <EOF>, as there is one too many ends. On the other hand, if you did this:

function test(arg1, arg2)
if arg1 then
print(arg2)
end

test(true, "Hello, world!")
It would still error with <EOF>. So, when I get the EOF statement, I usually add an end onto the line it errors on. If it errors again, I take the added end off, and take another end off.
cheekycharlie101 #8
Posted 09 November 2012 - 07:32 AM
Usually <EOF> errors mean too many ends or too little ends, so if you had a function like this:

function test(arg1, arg2)
if arg1 then
print(arg2)
end
end
end

test(true, "Hello, world!")
it would error with <EOF>, as there is one too many ends. On the other hand, if you did this:

function test(arg1, arg2)
if arg1 then
print(arg2)
end

test(true, "Hello, world!")
It would still error with <EOF>. So, when I get the EOF statement, I usually add an end onto the line it errors on. If it errors again, I take the added end off, and take another end off.
your wrong. the second one would error "end expected"
digpoe #9
Posted 09 November 2012 - 07:33 AM
Usually <EOF> errors mean too many ends or too little ends, so if you had a function like this:

function test(arg1, arg2)
if arg1 then
print(arg2)
end
end
end

test(true, "Hello, world!")
it would error with <EOF>, as there is one too many ends. On the other hand, if you did this:

function test(arg1, arg2)
if arg1 then
print(arg2)
end

test(true, "Hello, world!")
It would still error with <EOF>. So, when I get the EOF statement, I usually add an end onto the line it errors on. If it errors again, I take the added end off, and take another end off.
your wrong. the second one would error "end expected"

Oh. Blame a game that I play that has Lua in it, then. If I miss an end, it usually <EOF> errors.
Luanub #10
Posted 09 November 2012 - 10:37 AM
Ends can cause EOF errors but are not the sole root cause. There can be many reasons for an EOF error. Looking for just an end mistake to correct the error could cause you to miss what the issue is with the code.

"In computing, end of file (commonly abbreviated EOF) is a condition in a computer operating system where no more data can be read from a data source. The data source is usually called a file or stream."

So basically there is an error in the code that will not let the rest of the code be read.

http://en.wikipedia.org/wiki/End-of-file
Goof #11
Posted 09 November 2012 - 11:13 AM
Can we stop this topic talk now…. Just cause, the issue is solved, so bye :-)