Attempt to get length of field 'xPos' (a number value)

I am trying to print out a value from a table, but I keep getting the error that is in the title.

The error says it is trying to get the length of the integer, but I did not ask for this, I just wanted it to print the value.

I am not sure how to solve this. 

--coin.lua local M = {} M.coinXY = { {xPos = 100, yPos = 100} } return M --spawncoin.lua local coin = require "coin" local M = {} function M.createCoin(parent) for i = 1, #coin.coinXY do print("The X position is: " .. tostring(#coin.coinXY[i].xPos)) end end return M

Thanks in advance!

PS: If @roaminggamer reads this, I received the same error when performing a table dump.

Oops, I found the error.

That extra hash.

Thanks for your prompt replies.  :stuck_out_tongue:

  1. **UPDATE** Good, glad you found the issue.

  2. Not sure what you typed for dump, but 

    – Use these SSK features to see what is in coin module table.print_r(coin) table.dump(coin) table.dump(coin.coinXY)

Thanks! 

Oops, I found the error.

That extra hash.

Thanks for your prompt replies.  :stuck_out_tongue:

  1. **UPDATE** Good, glad you found the issue.

  2. Not sure what you typed for dump, but 

    – Use these SSK features to see what is in coin module table.print_r(coin) table.dump(coin) table.dump(coin.coinXY)

Thanks!