IS (Check object type)

Top  Previous  Next

 

< expression > IS < name of type >

 

IS

checks the run-time type of an object.

name of type

any type including references (i.e. &BYTE) and arrays ( i.e. BYTE[]).

IS returns a Boolean value indicating if the result of expression is an object of type that implementing of or inherited from or equal to the given name of type.

 

The binary operator IS has highest priority, so use parenthesis when it is necessary.

 

For ANY, &ANY, *ANY, ?, *? types IS uses type of value contained in the specified variable/parameter. One exception: if IS has form IS ANY. In this case:

 

*? IS ANY returns TRUE (1)

? IS ANY returns FALSE (0)

<variable of ANY type> IS ANY returns true

 

Also, user should keep in mind that System.String is used as type of expression, containing CLASTRING. As a result, the type of such expression is System.String. The only exception – expression that is CLASTRING variable. In the latter case the type of expression is CLASTRING.

 

The TYPEOF and IS operators are new to Clarion .NET. They are analogous to typeof and is operator in C#.

 

See Also: TYPEOF(Get System Type object)