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

bios:337: [string "ecran"]:5: '<name>' expected

Started by LeKiwiOriGinal, 09 September 2013 - 01:22 PM
LeKiwiOriGinal #1
Posted 09 September 2013 - 03:22 PM
Title: bios:337: [string "ecran"]:5: '<name>' expected

Hi guys today i just copy a program from a video ( [media]http://youtu.be/yRg2GYrVUDU[/media] They show the program at 1.30min ) and when i want to run it, it says :
"bios:337: [string "ecran"]:5: '<name>' expected"

I have never write a program before then i don't know what is wrong. I probably missed something but i don't know what it is.

Here is the program : http://pastebin.com/VrrVLJLJ

Thanks for your help !
LBPHacker #2
Posted 09 September 2013 - 04:14 PM
Decide if you want print to concatenate the arguments or if you want to do that yourself. I suggest doing it yourself:
print(x .. ":" .. y)
The concatenation operator consists of two dots, not a dot and a comma.
LeKiwiOriGinal #3
Posted 10 September 2013 - 08:33 AM
Thank you but now it says :
" bios:337: [string "ecran"]:72: 'end' expected
( to close 'function' at line 35)

I try to put an espace before function but it still stay this.
LBPHacker #4
Posted 10 September 2013 - 09:52 AM
You miss an 'end' at line 38 which would close the IF. This is not Basic, this is Lua.
LeKiwiOriGinal #5
Posted 10 September 2013 - 10:00 AM
Okay i have an other same error but i fix it.
Now i run it and still an error :
>ecran
79:10
ecran:52: attempt to call nil
LBPHacker #6
Posted 10 September 2013 - 10:06 AM
Line 31. I could have spotted that last time if I had put the code into Notepad++. Sorry.
LeKiwiOriGinal #7
Posted 10 September 2013 - 10:11 AM
I don't see what is wrong line 31 ?
LBPHacker #8
Posted 10 September 2013 - 10:16 AM
Hmm… Somehow that IF moved to line 32 since last time. Anyways, around line 31 there is another IF without an 'end'.
LeKiwiOriGinal #9
Posted 10 September 2013 - 10:39 AM
When i add an end at line 32 it says bios:337:[string "ecran"]:35: '<eof>' expected

When there is 3 end it says there is a end too much but when there is 2 end you say one end is missing. So i don't know what is wrong.
LBPHacker #10
Posted 10 September 2013 - 11:12 AM
That's because you didn't add the end at line 32 but at line 27 or so. http://pastebin.com/gQUmgmyJ
LeKiwiOriGinal #11
Posted 10 September 2013 - 11:16 AM
Still the same error with your pastebin :
>ecran
123:51 attempt to call nil
LBPHacker #12
Posted 10 September 2013 - 11:49 AM
That's not the same. That's your typo, writing setCursorPos as setCurorPos.
LeKiwiOriGinal #13
Posted 10 September 2013 - 12:36 PM
Thank you so much that is beautiful now !