ClassOf
The ClassOf function returns the data type of a variable.
Syntax
The ClassOf function
has the following syntax:
String = ClassOf(Var)Parameters
The ClassOf function
has the following parameter.
Parameter |
Format |
Description |
|---|---|---|
|
Variable |
Variable whose format you want to obtain. |
Return value
Data type name for the variable.
Note:
- If you pass an integer variable to
ClassOfit returns as long in IPL and returns as double in JavaScript. - If you pass a context variable to
ClassOf, it returns asBindingsVarGetSettablein IPL and returns asJavaScriptScriptableWrapperin JavaScript. - If you pass an
OrgNodevariable toClassOf, it returns asOrgNodein IPL and returns asVarGetSettablein JavaScript.
Example
The following example shows how to return the data type of a variable:
MyString = "This is a string.";
MyType = ClassOf(MyString);
Log(MyType);This example prints the following message to the policy log:
Parser Log: String