Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

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.

0
Oh ty, think I understand know. It's apprently very simple JustHerezForQuestion 7 — 4y
0
No problem! And ignore the fact that I used // for comments instead of -- lol. I was programming in Java while writing that Shawnyg 4330 — 4y
Ad

Answer this question