typeof

Returns the type of variable being checked as a string.

Syntax:

typeof(variable);


ArgumentDescription
variable The variable to get the type of.


Returns: String


Description

This function returns the data type of any given variable as a string. The possible return values are listed in the table below:

StringDescription
numberThe variable holds a real (floating point) number
stringThe variable holds a string
arrayThe variable references an array
boolThe variable holds a boolean (true / false)
int32The variable holds a 32bit integer
int64The variable holds a 64 bit integer
ptrThe variable holds a pointer
undefinedThe variable is undefined
nullThe variable holds a null value (this should not be seen normally)
vec3The variable holds a 3 value vector
vec4The variable holds a 4 value vector
unknownValue is unknown. This should never be seen and signifies that something has gone wrong at the most basic level like a memory overwrite



Example:

data_str = typeof(global.ExtensionInput);

The above code gets the data type held by the given global variable and returns the string to an instance variable.


Back: Data Types
Next: is_string

© Copyright YoYo Games Ltd. 2016 All Rights Reserved