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

(1.4) Multiple points error

Started by Sariaz, 23 September 2012 - 04:32 AM
Sariaz #1
Posted 23 September 2012 - 06:32 AM
Bug: program prints out multiple points then exits without doing anything else i have seen this in a few other programs usually fixes itself this time it hasn't

here is code that is being bad:

if position == "nil" then
local x,y = term.getSize()
pos = "1,1,"..x-1..","..y
else
pos = position
end

position is a string passed into the function this is in that is later turned into a table of numbers used for positioning and i have this setup so that if u give it nil it will do the max possible way is erring is the pos = "1,1"..x-1..","..y bit if i take out the x and y variables and substitute them for numbers it won't error but if i change it back it starts crashing again. Also I've found that around when I've fixed the bug (then change back i think) the computer stops realizing the code has been changed (editing outside of mc). Last two points are that there is no error msg just multiple points then finishes as if the program had finished and two that in the other lua environment I've used i have never encounter this problem. Sorry if i made post too long if u need more info let me know.

-Sariaz
Cloudy #2
Posted 23 September 2012 - 09:25 AM
Multiple points IS the error message. It also isn't a bug. Basically you've got "x-1.." - lua interprets the .. after 1 as being a number with two decimal points which obviously isn't correct. Decrement the x in another variable then concactenate it or experiment with brackets.
Mtdj2 #3
Posted 23 September 2012 - 12:47 PM
You could also make a space ( ) between the number and the dots…
Sariaz #4
Posted 23 September 2012 - 02:25 PM
ok thank you I'm guessing that the other lua environment i used must have fixed it for me since i never had that problem but very annoyed that i should just be able to fix with two spaces >:P/>/> thanks for telling me though. When i said it wasn't an error msg i meant that it didn't have the usual error msg formatting with program name then line number then problem or anything like that just the plain old msg multiple points. Thanks again this has been a major roadblock keeping me from my goals.