25.01.2015 Views

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

%OnNew<br />

20.8 %OnNew<br />

This instance method is called by the %New method at the point when all the storage for an<br />

object has been allocated and properties with initial values have had their values set. This<br />

method allows you to pass initialization information to a new instance, such as the location<br />

where an object resides on disk or a unique identifier.<br />

Its syntax is:<br />

ReturnValue %OnNew(InitialValue As %CacheString)<br />

where:<br />

ReturnValue<br />

InitialValue<br />

A %Status code, where an error stops the creation of the object.<br />

A string that the method uses in setting up the object.<br />

This method is available to the %Library.RegisteredObject class and its subclasses.<br />

20.9 %OnOpen<br />

This instance method is called by the %Open method just before an object is opened. It<br />

allows you to verify the state of an instance compared to any relevant entities; for instance,<br />

you can use the method also to ensure the function of an object's real-world analog.<br />

Its syntax is:<br />

ReturnValue %OnOpen()<br />

where:<br />

ReturnValue<br />

A %Status code, where an error stops the opening of the object.<br />

This method is available to the %Library.Persistent class and its subclasses.<br />

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

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

Saved successfully!

Ooh no, something went wrong!