Difference between revisions of "(global)"

From GiderosMobile
(Created page with "__NOTOC__ '''Supported platforms:''' <br/> '''Available since:''' Gideros 2011.6<br/> === Description === Global scope of Lua environment{|- | style="width: 50%;"| === Methods...")
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Supported platforms:''' <br/>
+
'''Supported platforms:''' android, ios, mac, pc<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== Description ===
Global scope of Lua environment{|-
+
Global scope of Lua environment
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
{|-
 
| style="width: 50%;"|
 
| style="width: 50%;"|
 
=== Methods ===
 
=== Methods ===
 +
[[assert]] - error if v nil or false, otherwise returns v<br/>
 +
[[collectgarbage]] - opts: stop, restart, collect, count, step, setpause, setstepmul<br/>
 +
[[dofile]] - executes as Lua chunk, default stdin, returns value<br/>
 +
[[error]] - terminates protected func, never returns<br/>
 +
[[getfenv]] - gets env, f can be a function or number(stack level)<br/>
 +
[[getmetatable]] - returns metatable of given object, otherwise nil<br/>
 +
[[ipairs]] - returns an iterator function, table t and 0<br/>
 +
[[loadfile]] - loads chunk without execution, returns chunk as function, else nil plus error<br/>
 +
[[loadstring]] - loads string as chunk, returns chunk as function, else nil plus error<br/>
 +
[[next]] - returns next index,value pair, if index=nil(default-, returns first index<br/>
 +
[[pairs]] - returns the next function and table t plus a nil, iterates over all key-value pairs<br/>
 +
[[pcall]] - protected mode call, catches errors, returns status code first<br/>
 +
[[print]] - prints values to stdout using tostring<br/>
 +
[[rawequal]] - non-metamethod v1==v2, returns boolean<br/>
 +
[[rawget]] - non-metamethod get value of table[index], index != nil<br/>
 +
[[rawset]] - non-metamethod set value of table[index], index != nil<br/>
 +
[[require]] - loads package, updates _LOADED, returns boolean<br/>
 +
[[setfenv]] - sets env, f can be a function or number(stack level, default=1-, 0=global env<br/>
 +
[[setmetatable]] - sets metatable, nil to remove metatable<br/>
 +
[[tonumber]] - convert to number, returns number, nil if non-convertible, 2<=base<=36<br/>
 +
[[tostring]] - convert to string, returns string<br/>
 +
[[type]] - returns type of v as a string<br/>
 +
[[unpack]] - returns all elements from list<br/>
 +
[[xpcall]] - pcall function f with new error handler err<br/>
 
| style="width: 50%;"|
 
| style="width: 50%;"|
 
=== Events ===
 
=== Events ===
 
=== Constants ===
 
=== Constants ===
 +
[[_G]]
 +
[[_VERSION]]
 
|}
 
|}

Revision as of 09:57, 23 August 2018

Supported platforms: android, ios, mac, pc
Available since: Gideros 2011.6

Description

Global scope of Lua environment
















Methods

assert - error if v nil or false, otherwise returns v
collectgarbage - opts: stop, restart, collect, count, step, setpause, setstepmul
dofile - executes as Lua chunk, default stdin, returns value
error - terminates protected func, never returns
getfenv - gets env, f can be a function or number(stack level)
getmetatable - returns metatable of given object, otherwise nil
ipairs - returns an iterator function, table t and 0
loadfile - loads chunk without execution, returns chunk as function, else nil plus error
loadstring - loads string as chunk, returns chunk as function, else nil plus error
next - returns next index,value pair, if index=nil(default-, returns first index
pairs - returns the next function and table t plus a nil, iterates over all key-value pairs
pcall - protected mode call, catches errors, returns status code first
print - prints values to stdout using tostring
rawequal - non-metamethod v1==v2, returns boolean
rawget - non-metamethod get value of table[index], index != nil
rawset - non-metamethod set value of table[index], index != nil
require - loads package, updates _LOADED, returns boolean
setfenv - sets env, f can be a function or number(stack level, default=1-, 0=global env
setmetatable - sets metatable, nil to remove metatable
tonumber - convert to number, returns number, nil if non-convertible, 2<=base<=36
tostring - convert to string, returns string
type - returns type of v as a string
unpack - returns all elements from list
xpcall - pcall function f with new error handler err

Events

Constants

_G _VERSION