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

Do expected

Started by Finn, 18 July 2015 - 01:46 PM
Finn #1
Posted 18 July 2015 - 03:46 PM
When I try to run the program, I get an error

bios:14: [string "weator.app"]:16: 'do' expected
How I can fix it?
The code is here http://pastebin.com/9Z21T5d4
KingofGamesYami #2
Posted 18 July 2015 - 05:57 PM

for i=1, xSize n do --#line 16
  paintutils.drawPixel(i,1,colors.lightBlue)
end

Either you meant to do this:

for i = 1, xSizen do

or this:

for i = 1, xSize, n do
Finn #3
Posted 19 July 2015 - 06:33 AM
http://www.computercraft.info/forums2/index.php?/topic/24026-do-expected/page__view__findpost__p__226
Thanks, but i have a new problem

weator.app:16: 'for' limit must be a number
flaghacker #4
Posted 19 July 2015 - 09:44 AM
You never defined the n you use in the for loop on that line. What do you expect it to do?
Lyqyd #5
Posted 19 July 2015 - 09:49 AM
xSize is never defined either.
Bomb Bloke #6
Posted 19 July 2015 - 10:24 AM
Let's just assume that this loop:

for i=1, xSize n do
  paintutils.drawPixel(i,1,colors.lightBlue)
end

… is supposed to turn the first line light blue. It'd be easier to just do this instead:

term.setCursorPos(1,1)
term.setBackgroundColour(colours.lightBlue)
term.clearLine()

If you wanted to turn the whole screen light blue, it'd just be:

term.setBackgroundColour(colours.lightBlue)
term.clear()
Finn #7
Posted 19 July 2015 - 01:07 PM
Let's just assume that this loop:

for i=1, xSize n do
  paintutils.drawPixel(i,1,colors.lightBlue)
end

… is supposed to turn the first line light blue. It'd be easier to just do this instead:

term.setCursorPos(1,1)
term.setBackgroundColour(colours.lightBlue)
term.clearLine()

If you wanted to turn the whole screen light blue, it'd just be:

term.setBackgroundColour(colours.lightBlue)
term.clear()
Thanks, it does work