Jump to content




Nil Argument Error?


  • You cannot reply to this topic
3 replies to this topic

#1 Symmetryc

  • Members
  • 434 posts

Posted 16 December 2013 - 09:31 PM

Alright so there is this really weird thing going on that I don't quite understand:
term.setBackgroundColor(colors.blue) --> No error, works normally
term.setBackgroundColor(colors.blue, nil) --> Number expected error
term.setBackgroundColor(colors.blue, 0) --> Still Number expected error

local termxsetBackgroundColor = function(_color, _extra)
return term.setBackgroundColor(_color, _extra)
end
termxsetBackgroundColor(colors.blue) --> Number expected error
Can anyone explain? Thanks!

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 16 December 2013 - 09:55 PM

Java side probably just complains whenever the argument count is wrong or if the argument type is wrong.

#3 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 16 December 2013 - 09:57 PM

I'm just going to put my theory out there that I stated in the PM.

I have a feeling it may be something Java-side (I will confirm later). The method signature may be public void setBackgroundColour(int colour, int someOtherInt) and when you supply 2 or more args they're passed to the method, instead of just the first being passed along with the other int that is added in on the Java-side

EDIT: Oh Lyqyd the ninja. haha.

Edited by theoriginalbit, 16 December 2013 - 09:57 PM.


#4 Symmetryc

  • Members
  • 434 posts

Posted 16 December 2013 - 09:57 PM

View PostLyqyd, on 16 December 2013 - 09:55 PM, said:

Java side probably just complains whenever the argument count is wrong or if the argument type is wrong.
Yeah that's what BIT said. Do you think that this warrants a thread move to the Bug section? Or would it be out of their control due to their use of LuaJ? I don't know the specifics on that stuff :/.

Edit: Ninja'd by BIT :/

Edit 2: Lol Ninja chaining (How I ironic :P)

Edited by Symmetryc, 16 December 2013 - 09:59 PM.






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users