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

[Error] bios:206: '=' expected

Started by Eduard Leo, 09 November 2012 - 09:22 PM
Eduard Leo #1
Posted 09 November 2012 - 10:22 PM
Hi all!
I have recently started to work with computercraft (in tekkit) and i made a code for my distribution system im going to make.

I have read some tutorials and i got this:

print ("Please enter object you want")
object = read("*")
print ("How many?")
number = read("*")
if object == a then
print ("Works a")
ifelse object == b then
print ("Works b")
else print ("No valid object")
Explaination:
It has to ask what item you want (object) for example object a
It has to ask how many you want, which is going to be used with redpulse.
The ifelse are used so i can add more items (for example, it can read if i want iron, dirt, cobble or gunpower)
For testing purposes, i have it had print a text, but this program doesnt seem to work.
I get the error

bios:206: [string "Nameprogram"]"7" '=' expected

I hope you can help me find out what i did wrong (its probebly something very stupid) since i already tried fixing it.

Thank you!
remiX #2
Posted 09 November 2012 - 10:33 PM

print ("Please enter object you want")
object = read("*")
print ("How many?")
number = read("*")
if object == "a" then	-- Needs " " around it
  print ("Works a")
elseif object == "b" then	-- Needs " " around it and it's elseif not ifelse :unsure:/>/>
  print ("Works b")
else print ("No valid object")
end    -- Need an end for if statement