DLuaEditor.GetCode

From GMod Wiki

Jump to: navigation, search
Function
Syntax DLuaEditor.GetCode( )
Description:
Get's the code located inside the DLuaEditor control
Returns: String code
In Object: DLuaEditor
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DLuaEditor.GetCode]DLuaEditor.GetCode [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCreates an LUA editor and adds some basic code, then prints the controls contents console!
Used onNewerClient.png
Code
local luaeditor = vgui.Create( "DLuaEditor", yourframe )
luaeditor:SetPos( 10, 30 )
luaeditor:SetSize( 200, 300 )
luaeditor:SetCode([[
/* Oh Wow */
local garry = GetGlobalInt("awsomeness")
 
print(garry)
]])
 
print(luaeditor:GetCode())
 
OutputThe code will be printed after console. This will happen once, after the control has been created
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox