Chapter Contents

Previous

Next
Class Class: _setMethod

Class Class: _setMethod



Adds or changes a method of a class


Syntax
Details

Syntax

objectName._setMethod( methodName, entry );
objectName._setMethod( methodName, entry, label );

Argument Type Use Description
methodName Character Input specifies the name of the method to change or add on the class
entry Character Input specifies the three- or four-level name of the SAS/AF entry where the method code is implemented
label Character Input specifies the SCL label where the METHOD statement is found when the entry is an SCL entry


Details

_setMethod allows you to add or replace a method for a class. After invoking _setMethod, a call to method on instances of objectName (or instances of its subclasses which have not overridden or disabled methodName) will execute the entry. If you replace a method in a class, there is no way to invoke the old method. For example, if you replace the _setMethod method of the Class class, you make it impossible to change any methods of any class (there will be no way to restore the old definition of the method).

CAUTION:
Avoid defining new methods with names that begin and end with underscores. Although the _setMethod method allows you to add new methods that begin and end with underscores, you are discouraged from doing so in order to prevent conflicts with new methods that may be added in future releases of SAS/AF software.  [cautionend]

Note:   Changes to a class's methods do not persist across SAS sessions or separate SAS/AF sessions and are not stored in the CLASS entry or the modified class.  [cautionend]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.