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

[error] bios:338: [string "Stripmine"}]:17: '=' expected

Started by epicly_noob, 15 December 2012 - 11:17 AM
epicly_noob #1
Posted 15 December 2012 - 12:17 PM
i copied this program from a forum and can't get it to work
here is the code i have in my turtle:



height = 2
length = 20
lengthCount = 0
heightCount = 1
function digHeight()
turtle.dig()
turtle.forward()
lenghtCount = lengthCount + 1
while heightCount < height do
turtle.digUp()
turtle.up()
heightCount = heightCount + 1
end
while heightCount > 1 do
turtle.down()
heightCount + heightCount - 1
end
end
while lengthCount < length do
digHeight()
end
turtle.turnLeft()
digHeight()
digHeight()
digHeight()
turtle.turnLeft()
lengthCount = 0
while lengthCount < length do
digHeight()
end
turtle.turnLeft()
digHeight()
digHeight()
digHeigh()
ChunLing #2
Posted 15 December 2012 - 12:25 PM
The parser needs to know what do do with the value of "heightCount + heightCount - 1". Where do you store that?
remiX #3
Posted 15 December 2012 - 12:28 PM
heightCount + heightCount - 1
The parser needs to know what do do with the value of "heightCount + heightCount - 1". Where do you store that?

I'm sure he meant
heightCount = heightCount - 1
seeming as the + is achieved from the same key as = but only if you hold shift. He must've have held shift ;)/>
epicly_noob #4
Posted 15 December 2012 - 12:49 PM
heightCount + heightCount - 1
The parser needs to know what do do with the value of "heightCount + heightCount - 1". Where do you store that?

I'm sure he meant
heightCount = heightCount - 1
seeming as the + is achieved from the same key as = but only if you hold shift. He must've have held shift ;)/>
omg wow i didn't notice that thx
theoriginalbit #5
Posted 15 December 2012 - 02:27 PM
heightCount + heightCount - 1
The parser needs to know what do do with the value of "heightCount + heightCount - 1". Where do you store that?

I'm sure he meant
heightCount = heightCount - 1
seeming as the + is achieved from the same key as = but only if you hold shift. He must've have held shift ;)/>
omg wow i didn't notice that thx

just a little tip for you. the error information is AWESOME. see this: your title


[error] bios:338: [string "Stripmine"}]:17: '=' expected


it tells you that at line 17 in the program "Stripmine" that it expected an '=' sign. :)/>

hope this helps, any questions…. just ask :)/>
Doyle3694 #6
Posted 16 December 2012 - 12:53 AM
The error codes are very confusing, so don't judge him
theoriginalbit #7
Posted 16 December 2012 - 01:06 AM
The error codes are very confusing, so don't judge him

not judging. just informing incase he was unaware.

they could be more confusing, they could be like C++ and not tell you anything relevant about the error. the lua errors are, for the most part, a god send in comparison, we have heaps on info in it, we know that the program is called Stripmine, and that at line 17 there is a problem, and that it was expecting and '=' sign when clearly there wasn't.