User Tools

Site Tools


is_check_object_type_.htm
Navigation:  Clarion.Net (Clarion#) > Clarion# Language Extensions > Operators >====== IS (Check object type) ====== Previous pageReturn to chapter overviewNext page

NewCNet.jpg

<; expression > IS <; name of type >

IS checks the run-time type of an object.
name of type any type including references (i.e. &amp;BYTE) and arrays ( i.e. BYTE[]).

blk2blue.jpg

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.

NoteBox.jpg

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

For ANY, &amp;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)

is_check_object_type_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1