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

Unknown error; 100

Started by iRichard, 23 January 2014 - 12:48 PM
iRichard #1
Posted 23 January 2014 - 01:48 PM
I have created a program which the line of a train let us know. But when I run the program it says in the red; 100. What is wrong? And what does the 100 mean?
pastebin.com/G2NwRPYg
surferpup #2
Posted 26 January 2014 - 11:03 PM
This is a bit difficult for me to wade through in a language other than English.. However, some ideas:

Usually, a red message (on an advanced computer) with a number in it is a program error. The number (100) indicates which line encountered the error. You did not post the entire error message, and that would be helpful.

In the following error message, the program encountered an error in the code file vs at line 107. It also gives me an indication of what kind of error the program encountered.

vs:107 attempt to perform arithmetic __add on nil and number

In this case, I attempted to increment a variable that had never been declared on line 107 in the file vs:


newVariable = newVariable + 1

For you, take a close look at the error. Since your code is less than 100 lines long, the error was probably in one of the APIs you call. Most likely, you are passing an argument to an API function which is not properly set or is of the wrong expected type. Without seeing more, that is my best guess. In looking over your code, it seems that you only posted part of it, so the error may actually be in your main code file (otherwise, why would you have the variable present, and you appear to do nothing with the worldSensor).
Edited on 26 January 2014 - 10:04 PM
iRichard #3
Posted 29 January 2014 - 12:12 PM
It's fixed. Have found that the program was not even running.There really was only 100. Nothing else.
robhol #4
Posted 29 January 2014 - 02:08 PM
For future reference: try to always code in English.
iRichard #5
Posted 29 January 2014 - 04:42 PM
The code is in English (??), But that makes his peripheral issues which make it easier. Think of it as a report that it was successful. Farther nothing.
example:
NL:
print("[ERROR] Bestand '"..dienstbestand.."' is er niet!")
EN:
print ("[ERROR] File '"..dienstbestand.."' is not!")
"Dienstbestand" is a string. But I will translate it now in the future.
theoriginalbit #6
Posted 29 January 2014 - 06:07 PM
There really was only 100. Nothing else.
This was a problem with OpenPeripheral 0.2.1-Preview8 … however this problem has been long since fixed, it was one of the first things I fixed…
robhol #7
Posted 30 January 2014 - 01:37 AM
The code is not in English. Variable names, comments, etc. should all be in English, not just because it's good practice, but because readability depends on it.
theoriginalbit #8
Posted 30 January 2014 - 01:43 AM
The code is not in English. Variable names, comments, etc. should all be in English, not just because it's good practice, but because readability depends on it.
No they really shouldn't be. Don't force people into using English, they should use whatever is easier to read for them. Just 'cause you cannot read the language they use doesn't mean that they should cater to you. A programmer that is willing/wanting to help others should be able to interpret code no matter the variable naming conventions or anything of the such, 99% of the code we see here is comment-less, so that being in a different language really doesn't matter!
The only thing that is forced to be in English on these forums is the posts themselves.
Edited on 30 January 2014 - 12:44 AM
oeed #9
Posted 30 January 2014 - 01:54 AM
I can understand why, especially in a language such as Lua which is heavily keyword based (other languages, even C to an extent, use symbols rather than words), one would encourage the American "speak English or get out of my country" rule.

However, a good majority, quite possibly over 50%, of the users on the forums have another language as their first language. So you can't really force someone to use English in their own code.
surferpup #10
Posted 30 January 2014 - 02:06 AM
This is a bit difficult for me to wade through in a language other than English..

The actual code is in Lua, however, the variables and text were in a language other than english. I certainly don't fault the coder for comments, strings and variables in a language other than english. Heck, the question was in english – so kudos to the coder for being able to ask. The only point I made was that I had trouble helping in this case, and that my ability to troubleshoot the code was hampered (translation, I suck at whatever the coder's language is – and that is my issue). I think it is marvelous that 1) he is writing code in Lua, and 2) that iRichard was able to communicate with the forum and get help at all.

I certainly did not mean any disrespect to the coder for not speaking english natively.
theoriginalbit #11
Posted 30 January 2014 - 02:09 AM
-snip-
I definitely was not aiming what I said at you. You made a statement mentioning that you found it difficult but still provided help, robhol on the other hand:
The code is not in English. Variable names, comments, etc. should all be in English, not just because it's good practice, but because readability depends on it.
he provided no help and told the OP that they must code in English, that is who I was aiming my reply at.
robhol #12
Posted 30 January 2014 - 03:37 AM
No they really shouldn't be. Don't force people into using English, they should use whatever is easier to read for them. Just 'cause you cannot read the language they use doesn't mean that they should cater to you. A programmer that is willing/wanting to help others should be able to interpret code no matter the variable naming conventions or anything of the such, 99% of the code we see here is comment-less, so that being in a different language really doesn't matter!
The only thing that is forced to be in English on these forums is the posts themselves.

Oh for the love of god, is it some kind of fad to disagree with and (hopefully intentionally) misconstrue everything I say?
I can read German just fine, that's not the point. It's not about "catering", it's about readability, and sharing code - both of which are obviously a problem in this very case!

Point to any recognized projects or libraries that use non-English names, comments etc.
Coding in English is an accepted convention, and it is for a reason. It's the same reason you don't name every variable "foo", "bar" or "sdoagihq" - clarity matters.
theoriginalbit #13
Posted 30 January 2014 - 03:56 AM
Oh for the love of god, is it some kind of fad to disagree with and (hopefully intentionally) misconstrue everything I say?
When you're wrong, or trying to force people into doing something they just don't need to, then yes I will have a counter to everything you say, just to make sure that other people don't get the same idea in their heads.

I can read German just fine, that's not the point. It's not about "catering", it's about readability, and sharing code - both of which are obviously a problem in this very case!
I cannot read German — I did not even realise that code was in German, I was actually thinking Swedish — and I do not need OP to make their code English, it is very readable to me (especially since they have correct indenting) I can understand every element of that code, I treat code in other languages the same as I treat obfuscated code, I take a step back and don't rely on them writing well documented code with good naming conventions; I go and figure out what each variable is myself and apply my own name to it — if I even need to do that.

It's the same reason you don't name every variable "foo", "bar" or "sdoagihq" - clarity matters.
Exactly I don't name them "foo" or "bar" 'cause I name them something that makes sense to me, important word there me. Why should I cater to someone else just so they can read my code, if by doing so means I struggle to understand it myself; write in whatever language is comfortable to you, there is no need to cater to others 'cause if they truly wish to read your code or help they don't need your variable names.
Edited on 30 January 2014 - 02:56 AM
Bomb Bloke #14
Posted 30 January 2014 - 04:30 AM
We're less then a page in and talking about a few dozen lines of code (written by someone who's apparently not altogether familiar with either ComputerCraft or English), but here's me being tempted to invoke Godwin's law already…

robhol, I don't know if you're taking your assertment that "all code should be English!" as seriously as you present it, but you've come off as being rudely demanding with it.

BIT, it's quite possible that robhol was making a "suggestion about best practises"; saying he's trying to "force people" might be stretching things a bit.

It's quite possible you'll both turn around and tell me that I'm wrong and you're both being combative intentionally, but it seems to me that this - ironically - is a miscommunication. Either way, I'll stand by the statement that there's no benefit in being uncivil to each other.

I can understand why, especially in a language such as Lua which is heavily keyword based (other languages, even C to an extent, use symbols rather than words), one would encourage the American "speak English or get out of my country" rule.
Speaking of arguing over trivialities, American English ~= English. ;)/>/>

That said, it's perhaps ironic that ComputerCraft veers away from this rule - for eg, there's a "colors.gray" for Americans, and a "colours.grey" for the rest of the world.
oeed #15
Posted 30 January 2014 - 04:50 AM
I can understand why, especially in a language such as Lua which is heavily keyword based (other languages, even C to an extent, use symbols rather than words), one would encourage the American "speak English or get out of my country" rule.
Speaking of arguing over trivialities, American English ~= English. ;)/>/>

That said, it's perhaps ironic that ComputerCraft veers away from this rule - for eg, there's a "colors.gray" for Americans, and a "colours.grey" for the rest of the world.

If you look at any of my code (PearOS might be an exception as I did it a year ago) I always use 'colours…' It does surprise me the amount of people who use colors, even people who speak normal English (e.g. GravityScore, who lives in Australia )
robhol #16
Posted 30 January 2014 - 07:57 AM
I guess it wasn't intentional.

Look, I'll try to spell this out: conventions exist for a reason. Adhering to conventions is a good thing. Maximizing the amount of people who're able to read your code is a good… thing….
It's not a demand, I was merely offering some advice and am not responsible for any extra meaning you choose to inject into my posts - for example "try to code in English (because it's easier on everybody and a good habit)" becoming "I personally demand that you code in a completely arbitrary language I designate, for no reason other than my whim".

Godwin's law does not apply. I'm tired of arguing with idiots.
Edited on 30 January 2014 - 06:59 AM
Lyqyd #17
Posted 30 January 2014 - 10:50 AM
Let's try to keep things civil, please. It doesn't really matter what language is used for code that is only intended for personal use. However, it is much easier for English speakers to read and understand the code if it is using English variable names and string constants. You're both at least partially right! It is good practice to code in English if you think there's any possibility that you'd want to share the code or need help with it, of course.

Looks like the actual problem was resolved, so we can all let this one rest. :)/>