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.

Table 1. ClassOf function parameters

Parameter

Format

Description

Var

Variable

Variable whose format you want to obtain.

Return value

Data type name for the variable.

Note:
  • If you pass an integer variable to ClassOf it returns as long in IPL and returns as double in JavaScript.
  • If you pass a context variable to ClassOf, it returns as BindingsVarGetSettable in IPL and returns as JavaScriptScriptableWrapper in JavaScript.
  • If you pass an OrgNode variable to ClassOf, it returns as OrgNode in IPL and returns as VarGetSettable in 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