Is_a()

Tests the type of an Open GENIE variable.

IS_A() var=Any typestring=String Checks to see what type an Open GENIE variable is

example:

	# Convert a real if necessary
	IF Is_a(x, "real")
	    x = As_integer(x)
	ENDIF

Note: Important when using user defined workspace types.

Is_a

The format of this command appears a little strange at first however it is designed to be easily used in the sort of programming situations where type checking is common, see the example above. It is possible to test a variable for being any Open GENIE predefined type or any user defined workspace type.

A generic type may also be checked for, for example

	>> printn Is_a(y, "Array")
	$TRUE
	>> printn Is_a(y, "Realarray")
	$FALSE

Parameters:

Var (Any)

The variable to be checked

Typestring (String)

The name of the type being checked for.

RESULT = (Boolean)

Returns $TRUE if the variable was of the type specified.