386 posts
Location
France
Posted 19 November 2012 - 08:45 AM
Hello everyone !
Sometimes when I want to edit my program, when I use edit … I got a try to call string error (or somethong like that) at line 108 of edit program!
I never touch any of the natives programs and it happen only sometimes…
It is a bug ? It is know ? Did someone else get the same error ?
1054 posts
Posted 19 November 2012 - 08:49 AM
What version of ComputerCraft do you have? In the edit from CC 1.46 I can't see anything near that line that could cause such an error.
386 posts
Location
France
Posted 20 November 2012 - 05:55 AM
What version of ComputerCraft do you have? In the edit from CC 1.46 I can't see anything near that line that could cause such an error.
I'm using 1.46 and an advanced computer… oh sorry it's at line 118 i got an error –'
386 posts
Location
France
Posted 29 November 2012 - 04:27 AM
So no one know ? Because it still tell me : edit : 118: attempt to call string when I edit a specific program. :(/>
1619 posts
Posted 29 November 2012 - 04:56 AM
You haven't made any changes in your ROM, and you don't have a program named edit amirite?
386 posts
Location
France
Posted 29 November 2012 - 05:23 AM
You haven't made any changes in your ROM, and you don't have a program named edit amirite?
No I never touch the ROM and any native program to avoid this kind of error…
818 posts
Posted 29 November 2012 - 05:29 AM
have you overwritten edit or any function in it?
386 posts
Location
France
Posted 29 November 2012 - 05:31 AM
have you overwritten edit or any function in it?
As said above, I never touch any of the native program/API
818 posts
Posted 29 November 2012 - 06:05 AM
well you can still overwrite functions….. Like the famous os.pullEvent = os.pullEventRaw overwrites os.pullEvent
1619 posts
Posted 29 November 2012 - 06:08 AM
well you can still overwrite functions….. Like the famous os.pullEvent = os.pullEventRaw overwrites os.pullEvent
Agreed, have you overwritten any functions bjor?
386 posts
Location
France
Posted 29 November 2012 - 06:20 AM
The program I try to edit is
http://pastebin.com/bEBmy1Zt and I never overwritte any function on this computer because it's my test computer so I let it as I found it XD
1054 posts
Posted 29 November 2012 - 06:21 AM
Did you experience this on advanced computers? And have you run any programs that declares the variable 'type'?
Edit: Did you run the program above sometimes before editing? It's on line 84.
2217 posts
Location
3232235883
Posted 29 November 2012 - 06:23 AM
The program I try to edit is
http://pastebin.com/bEBmy1Zt and I never overwritte any function on this computer because it's my test computer so I let it as I found it XD
line 84:
type = io.read()
stahp overwriting globals pl0x
1054 posts
Posted 29 November 2012 - 06:25 AM
Hehe, ninja fight. Bjorn, change line 84 to:
local type = io.read()
This is one of the best examples of why to use 'local' I've ever seen in practice. ^_^/>
386 posts
Location
France
Posted 29 November 2012 - 06:26 AM
Oh ok yes that was on an advanced computer and I run it and some other (which are declined from this one) that edit this variable… Thanks you all and sorry for my very noob question …
1054 posts
Posted 29 November 2012 - 06:28 AM
Oh ok yes that was on an advanced computer and I run it and some other (which are declined from this one) that edit this variable… Thanks you all and sorry for my very noob question …
No problem, we like to help you out. :)/> Do you understand what went wrong?
386 posts
Location
France
Posted 29 November 2012 - 06:31 AM
Oh ok yes that was on an advanced computer and I run it and some other (which are declined from this one) that edit this variable… Thanks you all and sorry for my very noob question …
No problem, we like to help you out. :)/>/> Do you understand what went wrong?
Yes, it's because I try to overwrite a variable with read() wich is already defined because it's a global and not a local variable. I didn't believe why I would use local variable instead of global before ^^
1054 posts
Posted 29 November 2012 - 06:39 AM
:)/> The real big problem here is that type is also a native function. And the edit programs uses that function at, indeed, line 118. Because it's redefined by your program, edit tries to call a string as if it was a function. :P/>
1548 posts
Location
That dark shadow under your bed...
Posted 29 November 2012 - 06:39 AM
nope. the problem is that the variable is 'type' that is actually a command used in the edit program, you turned it into a string
AAAAAARGH!!! NINJAS :angry:/>
1054 posts
Posted 29 November 2012 - 06:42 AM
nope. the problem is that the variable is 'type' that is actually a command used in the edit program, you turned it into a string
AAAAAARGH!!! NINJAS :angry:/>
Oh man, you're making me scared. :o/> You are indeed diabolical :P/>
1548 posts
Location
That dark shadow under your bed...
Posted 29 November 2012 - 06:47 AM
lol I'm going to stop helping people while at work, I always get ninja-ified…
386 posts
Location
France
Posted 29 November 2012 - 06:47 AM
Oh ok didn't know that before too ^^ I have a lot of thing to learn ^^ Thanks you alot !
2217 posts
Location
3232235883
Posted 29 November 2012 - 07:48 AM
also
you souldnt overwrite globals at all
localizing can still break functions in child blocks
386 posts
Location
France
Posted 29 November 2012 - 07:50 AM
also
you souldnt overwrite globals at all
localizing can still break functions in child blocks
I understand the lesson, now I will use local variables and functions ;)/>