Changes between Version 2 and Version 3 of documentation/LuaManual/Contexts
- Timestamp:
- 06/09/12 06:57:06 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
documentation/LuaManual/Contexts
v2 v3 19 19 20 20 {{{ 21 for key, doc in ipairs(context.documents :GetTable()) do21 for key, doc in ipairs(context.documents) do 22 22 print doc.title 23 23 end 24 25 local index = 026 local length = #context.documents:GetTable() / 227 while index < length do28 print (index .. ": " .. context.documents[index].title)29 end30 24 }}} 31 Because the items can be indexed by both string and integer keys, the contexts are duplicated in the table. This means that the size operator on ''context.documents:GetTable()'' returns twice as many items as there are contexts.32 25 33 26 It is also possible to access them as a dictionary, looking documents up by their ID: