Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I have a question about what does a "field" in tables mean?

I always see people saying "a field inside of a table", what does that mean? Is it like a key/value pair or something? can anyone give me a defintion couldn't find anything online

1 answer

✓ Accepted answer

A field is the key in a dictionary. Reason I say dictionary is because field generally isn't used when talking about a standard array, as the index is just 1,2,3 and so on. Imagine you have a dictionary for every single player that joins your game, and a key in that dictionary is "UserId", you could loop through every player's data (which is a dictionary) and access the field "UserId" and do whatever you wish with it. Ex:

local dictionary = {
	['UserId'] = 0, -- UserId is the field
	['Name'] = "Bob" -- Name is the field
}

If you have any SQL table experience, visualize a table in any SQL based application which allows you to edit your web data. Every column is considered a field.

2 comments

0

Oh ty, think I understand know. It's apprently very simple

0

No problem! And ignore the fact that I used // for comments instead of -- lol. I was programming in Java while writing that

This discussion is preserved as it was. New answers, comments, and votes are closed.