Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Lua Development Tools » for id, element in pairs( table ) do -- How to use luadoc?(How to get element exposed with intellisense?)
for id, element in pairs( table ) do -- How to use luadoc? [message #1733290] Thu, 26 May 2016 08:33 Go to next message
Sven Van de Velde is currently offline Sven Van de VeldeFriend
Messages: 15
Registered: March 2016
Junior Member
Hi,

I am using the LDT and the luadoc documentation standard extensively and with much success!

However, there is one syntax where i have a big question, and that is with for loops ...

My question is: In the underlying code fragment, how can i get the intellisense understand that Contact declared in the for do loop, is of type CONTACT?


thanks in advance for your help!

kind regards,
Sven


--- @type AGENT
-- @field #AGENT.CONTACTS Contacts
AGENT = {

  Contacts = {} 

}

--- @type CONTACT
CONTACT = {
  Name = "Sven",
  Address = "Rubenslei",
  City = "Antwerpen"
}

--- @type AGENT.CONTACTS
-- @list <#CONTACT>


do

  AGENT.Contacts[1] = CONTACT

  print( AGENT.Contacts[1].Name )

  for ContactID, Contact in pairs( AGENT.Contacts ) do
     
     print( Contact.Name )
  
  end

end


Re: for id, element in pairs( table ) do -- How to use luadoc? [message #1733299 is a reply to message #1733290] Thu, 26 May 2016 09:54 Go to previous message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
Registered: July 2009
Senior Member
This is not supported ...

a crappy workaround could be :

for ContactID, Contact in pairs( AGENT.Contacts ) do
     local contact1 = Contact --#CONTACT 
     print( contact1. name)
  end
Previous Topic:Possible to install NodeMCU in LDT
Next Topic:A good example of luadoc usage ...
Goto Forum:
  


Current Time: Sat May 04 00:54:24 GMT 2024

Powered by FUDForum. Page generated in 0.03668 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top