Difference between revisions of "Help.setPath"

From ComputerCraft Wiki
Jump to: navigation, search
(Created page with "{{lowercase}} {{Function |name=help.setPath |args=string path |api=help |addon=ComputerCraft |examples= {{Example |desc=Sets the path of the help API to /dis...")
 
(Fixed description, added an example)
 
(3 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=help.setPath
 
|name=help.setPath
|args=[[string (type)|string]] path
+
|args={{Type|string}} path
 
|api=help
 
|api=help
 +
|returns={{type|nil}}
 
|addon=ComputerCraft
 
|addon=ComputerCraft
 +
|desc=Sets the list of locations the API will look in for help files. This should be a string containing one or more search paths separated by colons.
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Sets the path of the help API to /disk/help
+
|desc=Sets the search path of the help API to /disk/help/. This replaces the original help lookup path.
|code=help.setPath("/disk/help")
+
|code='''help.setPath( "/disk/help/" )'''
 +
}}
 +
{{Example
 +
|desc=Adds /myfolder/help/ path to the current help path.
 +
|code='''help.setPath( [[help.path]]() .. ":/myfolder/help/" )'''
 
}}
 
}}
 
}}
 
}}
 +
 +
[[Category:API_Functions]]

Latest revision as of 21:07, 1 May 2015


Grid Redstone.png  Function help.setPath
Sets the list of locations the API will look in for help files. This should be a string containing one or more search paths separated by colons.
Syntax help.setPath(string path)
Returns nil
Part of ComputerCraft
API help

Examples

Grid paper.png  Example
Sets the search path of the help API to /disk/help/. This replaces the original help lookup path.
Code
help.setPath( "/disk/help/" )



Grid paper.png  Example
Adds /myfolder/help/ path to the current help path.
Code
help.setPath( help.path() .. ":/myfolder/help/" )