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

Read Function: '<name>' expected error

Started by Jode, 13 May 2012 - 10:36 AM
Jode #1
Posted 13 May 2012 - 12:36 PM
Code snippet:
local in = read()

Error: '<name>' expected

What the heck does that error even mean? Why can I run the read function on another Computer, but not this one? I'll post more code as needed.
vanir #2
Posted 13 May 2012 - 01:13 PM
"in" is a static keyword and cant be set to any value. its used in loops, u use it as keyword if i understand right.
Jode #3
Posted 13 May 2012 - 02:48 PM
… Oh. I feel stupid now. xD Thanks.
vanir #4
Posted 13 May 2012 - 03:14 PM
Happens to me more then one time before :P/>/> .. but maybe u should change topic to [solved] .. to say here is nothing to do or even a answer of the question.
Lyqyd #5
Posted 13 May 2012 - 05:40 PM
Leaving the topic title as the question makes it easier for people searching the forum to find the topic (and thereby the answer), which helps prevent having to answer questions over and over again.
Anora #6
Posted 02 February 2013 - 08:18 AM
im having a similor problem as well whit

function = Selection()

giving me the Error: '<name>' expected</name>
Kingdaro #7
Posted 02 February 2013 - 08:20 AM
"function" is a static keyword and cant be set to any value.
Anora #8
Posted 02 February 2013 - 08:22 AM
gotch yea
TheOddByte #9
Posted 02 February 2013 - 10:18 AM
im having a similor problem as well whit

function = Selection()

giving me the Error: '<name>' expected</name>

And why do you do:

function = Selection()
When You Just Should Do:

function Selection()
print("Hello This Is The Selection!")
end

--Then Call It
while true do
print("1 = Selection")
write("What Would You Like To Do?:")
input = read()
if input == "1" then
Selection()  -- Here It Calls It
else
print("Whaat?")
sleep(2)
end
ChunLing #10
Posted 02 February 2013 - 11:56 AM
Or Selection = function() … end.