25.01.2015 Views

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

21<br />

Object-Specific ObjectScript<br />

Features<br />

ObjectScript includes a number of features that provide special functionality within object<br />

methods. These are:<br />

• .. Syntax — For accessing a property or calling a method of the current object<br />

• ##Class Syntax — For invoking a class method or for casting an object reference as<br />

another class to call a method<br />

• ##this Syntax — For getting a handle to the OREF of the current instance, such as for<br />

passing it to another class or for another class to refer to the current instance's members.<br />

• ##super Syntax — For invoking a superclass method from within a subclass method<br />

• i% Syntax — For referencing an instance variable from within its own<br />

Get or Set accessor method, or bypassing its Get or Set method<br />

21.1 .. Syntax<br />

The .. syntax provides a mechanism for referencing another method or property of the current<br />

object. For example, suppose there is a Bricks property of type %Integer:<br />

Property Bricks As %Integer;<br />

A CountBricks method can then refer to Bricks with .. syntax:<br />

<strong>Using</strong> <strong>Caché</strong> <strong>Objects</strong> 179

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!