debug.getlocal
From GMod Wiki
This article is a stub. You can help the GMod Wiki by expanding it. |
Function | |
Syntax |
debug.getlocal( Integer level, Integer local ) Where is this used? |
Description: | |
This function returns the name and the value of the local variable with index local of the function at level level of the stack. (The first parameter or local variable has index 1, and so on, until the last active local variable.) The function returns nil if there is no local variable with the given index, and raises an error when called with a level out of range. (You can call debug.getinfo to check whether the level is valid.) | |
Returns: | String Name, Var Value |
Part of Library: | Debug |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Debug.getlocal]Debug.getlocal [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Prints in console. |
---|---|
Used on | |
Code | local TotalCakes = 12; local Name, Value = debug.getlocal( 1 , TotalCakes ); print( Name, Value ); |
Output | TotalCakes 12 |