![]() Chapter Contents |
![]() Previous |
![]() Next |
| SUPAPPLY |
| Category: | Object Oriented |
| Syntax | |
| Details | |
| Example | |
| See Also |
Syntax |
| CALL SUPAPPLY(object-id,method-name,arg-list-id); |
| return-value=SUPAPPLY(object-id,method-name,arg-list-id); |
Type: Numeric, Character, List, Object-name, Class, or Interface
| Details |
SUPAPPLY provides the same functionality as SUPER except that you can pass arguments to inherited methods in an SCL list. You use SUPAPPLY to execute an inherited method when you define another method that performs additional actions. A method that calls an inherited method and includes additional actions is called an overloaded method. See Overloading Methods for more information.
In Version 7, you must use dot notation to call overloaded methods. Dot notation provides compiler time checking and better performance at run time. With overloaded methods, the compiler must be able to check method signatures in order to call the correct method. For details about dot notation, see Accessing Object Attributes and Methods With Dot Notation.
The object identified by object-id
must be the same object whose method is currently executing. The identifier
for this object is stored in the system variable _SELF_. In methods defined
in a CLASS or USECLASS statement block, all references to the class methods
and attributes can bypass references to _SELF_.attribute
and _SELF_.method(...). For example, to call
a super method with dot notation in a method definition, you can use
supapply(); , which is equivalent
to
call supapply(_self_,'m1');.
| Example |
useclass lib.cat.myclass.class;
/* TRANSACT.SCL: TRANSACTION method */
Transaction: method arglist= transactions;
call supapply(_self_,'Transaction',transactions);
if audit then do;
nTransactions=listlen(transactions);
call putvarn(audit,tc_vnum,nTransactions);
call putvarn(audit,dt_vnum,datetime());
rc=update(audit);
end;
endmethod;
enduseclass;
dcl lib.cat.myclass.class obj=_NEW_lib.cat.myclass(); obj.Transaction(t1,t2,t3,t4,t5); obj.Transaction(t1,t2); obj.Transaction(listOftransactions);
| See Also |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.