|
|
|
Re: Documenting a Function That Returns an Array [message #1037996 is a reply to message #1037984] |
Wed, 10 April 2013 09:07 |
Assaf Inbal Messages: 8 Registered: April 2013 |
Junior Member |
|
|
Perhaps I'm missing something, so I'll give a better example of what I'm after.
Suppose I have the following code:
function get_users()
local user1 = {
name = "foo",
age = 20,
}
local user2 = {
name = "bar",
age = 20,
}
local users = {}
table.insert(users, user1)
table.insert(users, user2)
return users
end
users = get_users()
Now, I want to be able to have auto completion for the keys of each value in the users table.
For example:
users[1].<auto complete here (name or age)>
or
for _, user in pairs(users) do
print(user.<auto complete here (name or age)>)
end
I know how to document a function that returns a single user (a table with name/age keys), but, how would I go about writing the documentation for the get_users() function?
Thanks again for any help!
[Updated on: Thu, 11 April 2013 11:51] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07922 seconds