WoW:API type

From AddOn Studio
Revision as of 15:01, 4 January 2006 by WoWWiki>Anticrash
Jump to navigation Jump to search
type -Documentation by Darjk-

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:WoW API