Difference between revisions of "Help.lookup"

From ComputerCraft Wiki
Jump to: navigation, search
(Created page with "{{lowercase}} {{Function |name=help.lookup |args=string topic |api=help |returns=string path of help file for ''topic'' or nil |addon=Compu...")
 
(Update description and use type template)
 
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=help.lookup
 
|name=help.lookup
|args=[[string (type)|string]] topic
+
|args={{Type|string}} topic
 
|api=help
 
|api=help
|returns=[[string (type)|string]] path of help file for ''topic'' or nil
+
|returns={{Type|string}} path of help file for <var>topic</var> or [[nil]]
 
|addon=ComputerCraft
 
|addon=ComputerCraft
 +
|desc=Returns the path to the file containing the help page for <var>topic</var>, or [[nil]] if the topic cannot be found. Each element of the string returned by [[help.path]] is searched, in order, for a file named <var>topic</var>.
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Looks up the path for the disk api
+
|desc=Looks up the path for help on the disk API.
 
|code=print(help.lookup("disk"))
 
|code=print(help.lookup("disk"))
 
|output=/rom/help/disk
 
|output=/rom/help/disk
 
}}
 
}}
 
}}
 
}}
 +
 +
[[Category:API_Functions]]

Latest revision as of 19:53, 23 April 2013


Grid Redstone.png  Function help.lookup
Returns the path to the file containing the help page for topic, or nil if the topic cannot be found. Each element of the string returned by help.path is searched, in order, for a file named topic.
Syntax help.lookup(string topic)
Returns string path of help file for topic or nil
Part of ComputerCraft
API help

Examples

Grid paper.png  Example
Looks up the path for help on the disk API.
Code
print(help.lookup("disk"))
Output /rom/help/disk