|
| 08 Feb 2016 08:29 AM |
When I made a thing indexing tables, I made it run through local d={"mip",{car,BrickColor.Blue},7} Which didn't turn out so well (attempt to concatenate local 'Item' (a table value)) So I made a thing if Item~=table then (function) else print"no table-ception support" end
Which returned the same error. Help? |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2016 08:32 AM |
The error is elsewhere. You don't concatenate anywhere here. However, tables can't be compared like that as far as I know. |
|
|
| Report Abuse |
|
|
mityguy
|
  |
| Joined: 07 Jun 2008 |
| Total Posts: 5483 |
|
|
| 08 Feb 2016 08:41 AM |
| You use .. to concatenate not , |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2016 08:42 AM |
| That doesn't matter, he wasn't concatenating here. |
|
|
| Report Abuse |
|
|
triode
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 5844 |
|
|
| 08 Feb 2016 08:46 AM |
for i = 1, #Table:GetChildren() do if Table[i] == value then -- end end
Or for dictionaries:
If Dictionary[value] then |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2016 09:58 AM |
I was, I am just not posting the entire reader. Alright, here goes.
function TableRead(Table) if Table~=nil then print("TABLE READOUT START\nTABLE CONTENT = "..#Table) for ItemN, Item in pairs(Table) do --if Item~=Table --[[the problem line]]-- print(ItemN..": "..Item) --end --[[end to the problem if line]]-- end print("TABLE READOUT END\n") else print("TABLE NOT FOUND\n") end end
|
|
|
| Report Abuse |
|
|
|
| 08 Feb 2016 10:00 AM |
'print(ItemN..": "..Item)' That's where it is. Either ItemN or Item (Or both) are a table. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2016 10:01 AM |
type(value)
If I have a table t: print(type(t)) > "table" |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2016 10:02 AM |
Yeah Item is a table in d[2] d={string,{string,brickcolor},num}
So I made the if Item~=Table line but that threw an error |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2016 10:05 AM |
"So I made the if Item~=Table line but that threw an error"
Yeah because that's not how you check if an item is a table. If you want to check if it's a table, it's type(Item)~="table". |
|
|
| Report Abuse |
|
|
| |
|