Page 1 of 1

function attributes in the wrong order?

Posted: Mon Jul 21, 2014 12:01 am
by martov
Im getting some trouble debugging this, for some weird reason when I call my function the attibutes come into the function in the wrong order

im calling the function clases.manzana:create(love.mouse.getX,love.mouse.getY, sometable)
and if I print those values inside the function, the first attribute is the table, the second is the x position and the third is the Y position.

[screenshot here]
http://postimg.org/image/59qlmf387/full/

Im really confused, I tried changing the names of the variables to see if it was some scope issue or something, but it didnt work :/

Re: function attributes in the wrong order?

Posted: Mon Jul 21, 2014 12:49 am
by Kingdaro
You've defined the function "create" with a period ( . ), but are calling it with a colon ( : ). Use one or the other, and be consistent.

If you wish to know what these markings mean individually, here's some more info.

Re: function attributes in the wrong order?

Posted: Mon Jul 21, 2014 12:49 am
by davisdude
We need to see classes.mananza:create to really help you. Or a .love, preferably.

Re: function attributes in the wrong order?

Posted: Mon Jul 21, 2014 1:40 am
by martov
thanks Kingdaro!

now I understand what was happening. :neko: