Language > Objects > Using IDL Objects > Using the Class Reference

# Using the Class Reference

IDL’s object class library is documented in this section. The page or pages describing each class include references to any superclasses of the class, to the properties of the class, and to the methods associated with the class. Class methods are documented alphabetically following the description of the class itself.

A description of each method follows its name. Beneath the general description of the method are a number of sections that describe the Syntax for the method, its arguments (if any), its keywords (if any). These sections are described below.

## Object Method Syntax

In the IDL Reference Guide, the Syntax section of each object method shows the proper syntax for calling the method.

### Procedure Methods

IDL procedure methods have the syntax:

Obj.Procedure_Name, Argument [, Optional_Arguments]

or

Obj->Procedure_Name, Argument [, Optional_Arguments]

where Obj is a valid object reference, Procedure_Name is the name of the procedure method, Argument is a required parameter, and Optional_Argument is an optional parameter to the procedure method. The square brackets around optional arguments are not used in the actual call to the procedure, they are simply used to denote the optional nature of the arguments within this document.

### Function Methods

IDL function methods have the syntax:

Result = Obj.Function_Name(Argument [, Optional_Arguments])

or

Result = Obj->Function_Name(Argument [, Optional_Arguments])

where Obj is a valid object reference, Result is the returned value of the function method, Function_Name is the name of the function method, Argument is a required parameter, and Optional_Argument is an optional parameter. The square brackets around optional arguments are not used in the actual call to the function, they are simply used to denote the optional nature of the arguments within this document.

Note: All arguments and keywords to functions should be supplied within the parentheses that follow the function’s name.

## Arguments

The Arguments section describes each valid argument to the method.

Note: These arguments are positional parameters that must be supplied in the order indicated by the method’s syntax.

### Named Variables

Often, arguments that contain values upon return from the function or procedure method (“output arguments”) are described as accepting “named variables.” A named variable is simply a valid IDL variable name. This variable does not need to be defined before being used as an output argument. Note, however that when an argument calls for a named variable, only a named variable can be used—sending an expression causes an error.

### Keywords

The Keywords section describes each valid keyword argument to the method.

Note: Keyword arguments are formal parameters that can be supplied in any order.

Keyword arguments are supplied to IDL methods by including the keyword name followed by an equal sign (“=”) and the value to which the keyword should be set. Note that keywords can be abbreviated to their shortest unique length. For example, the XSTYLE keyword can be abbreviated to XST.

Note: In the case of Init, GetProperty and SetProperty methods, keywords often correspond to object properties. See Object Properties for additional discussion.

### Setting Keywords

When the documentation for a keyword says something similar to, “Set this keyword to enable logarithmic plotting,” the keyword is simply a switch that turns an option on and off. In general, setting such keywords equal to 1 (or using the /KEYWORD syntax) causes the option to be turned on. Explicitly setting the keyword to zero (or not including the keyword) turns the option off.

## Creating Objects from the Class Library

To create an object from the IDL object class library, use the OBJ_NEW function. See OBJ_NEW. The Init method for each class describes the arguments and keywords available when you are creating a new object.

For example, to create a new object from the IDLgrAxis class, use the following call to OBJ_NEW along with the arguments and keywords accepted by the IDLgrAxis::Init method:

myAxis = OBJ_NEW(IDLgrAxis, DIRECTION = 1, RANGE = [0.0, 40.0])