13.07.2015 Views

Using Caché Studio - InterSystems Documentation

Using Caché Studio - InterSystems Documentation

Using Caché Studio - 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.

StatementsIndex KeywordsKeywordDataFinalIdKeyPrimaryKeySqlNameTypeUniquePossible ValuesList of property namesBoolean. If present, specifies that this class cannot havesubclasses.BooleanBooleanSQL IdentifierBitmap | Bitslice | Index | KeyBooleanB.3.6 Method and ClassMethod StatementsThe Method statement defines (or overrides) an instance method for a class. The ClassMethod statementdefines a class method; that is, a method that can be executed with no instances of the class in existence.In every other respect, these statements are identical.Here is an example of an instance method:/// Print this object instance to the consoleMethod Print() [ Final ]{Write "Name: ", ..Name, !}Here is an example of a class method:/// Print any object instance to the console given its idClassMethod PrintObject(id As %String) [ Final ]{Set obj = ..%OpenId(id)}If (obj '= "") {Write "Name: ", obj.Name, !Set obj = ""}B.3.6.1 Method ArgumentsThe Method declaration includes its formal specification (FormalSpec); that is, a list of its formalarguments, if any. This list consists of one or more comma-separated argument names, their types (a<strong>Caché</strong> class name), and, optionally, their default values. The ByRef modifier indicates an argument<strong>Using</strong> <strong>Caché</strong> <strong>Studio</strong> 161

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

Saved successfully!

Ooh no, something went wrong!