Difference between revisions of "Help.topics"

From ComputerCraft Wiki
Jump to: navigation, search
(Table -> Table (type))
(Update description, reformat example and use ipairs to get sorted output, and use type template)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=help.topics
 
|name=help.topics
|args=
 
 
|api=help
 
|api=help
|returns=[[Table_(type)|Table]] all valid topics
+
|returns={{Type|table}} all valid topics
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=Lists all valid help topics
+
|desc=Returns a list of all available help topics. This is all files found in the directories in the search path returned by [[help.path]]. The returned table is sorted.
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Lists all valid help topics
+
|desc=Lists all valid help topics.
|code=for i,v in pairs(help.topics()) do print(v) end
+
|code=for _, v in ipairs(help.topics()) do
 +
  print(v)
 +
end
 
|output=List of all valid help topics
 
|output=List of all valid help topics
 
}}
 
}}

Revision as of 19:53, 23 April 2013


Grid Redstone.png  Function help.topics
Returns a list of all available help topics. This is all files found in the directories in the search path returned by help.path. The returned table is sorted.
Syntax help.topics()
Returns table all valid topics
Part of ComputerCraft
API help

Examples

Grid paper.png  Example
Lists all valid help topics.
Code
for _, v in ipairs(help.topics()) do
  print(v)
end
Output List of all valid help topics