Difference between revisions of "Multishell.getCurrent"

From ComputerCraft Wiki
Jump to: navigation, search
(Make multishell.getCurrent page)
 
m (Expanded)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 +
{{Lowercase}}
 +
 
{{Function
 
{{Function
|name=multishell.getCurrent
+
|name=multishell.getCurrent
|args=none
+
|api=multishell
|api=multishell
+
|returns={{type|number}} tabID
|returns={{type|number}} tabID
+
|addon=ComputerCraft
|addon=ComputerCraft
+
|desc=Returns the tab ID of the currently running program. You can use this along with other multishell functions, such as, [[multishell.getTitle]] and [[multishell.setTitle]].
|desc=Returns the tab that is currently active.
+
|examples={{Example
 +
|desc=Gets the currently running tab and prints it's title.
 +
|code= local currentTabID = '''multishell.getCurrent()'''
 +
 +
[[print]]([[multishell.getTitle]](currentTabID))
 +
|output=The title of the currently running program (tab)}}
 
}}
 
}}
 +
 
[[Category:API_Functions]]
 
[[Category:API_Functions]]

Latest revision as of 17:28, 2 June 2014


Grid Redstone.png  Function multishell.getCurrent
Returns the tab ID of the currently running program. You can use this along with other multishell functions, such as, multishell.getTitle and multishell.setTitle.
Syntax multishell.getCurrent()
Returns number tabID
Part of ComputerCraft
API multishell

Examples

Grid paper.png  Example
Gets the currently running tab and prints it's title.
Code
local currentTabID = multishell.getCurrent()

print(multishell.getTitle(currentTabID))
Output The title of the currently running program (tab)