WoW:API type

From AddOn Studio
Revision as of 16:52, 8 November 2007 by WoWWiki>Pcj
Jump to navigation Jump to search

Native Lua statement:

This function returns the type of variable was passed to it.

var = type(arg1);

Parameters

Arguments

(arg1)
arg1
Any - arg1 can be any variable, String, Integer, etc.

Returns

Returns
var
var
String - Contains the type of variable was passed as the argument. ie. "String", "Number", etc.

Example

local a = "I am a string";
local b = 45;
local c = type(a);
local d = type(b);


Result

c = "string"
d = "number"

Details

This function is part of the core lua language.
Possible return values (all strings):
"nil", "number", "string", "boolean", "table", "function", "thread", and "userdata".

Template:LUA