Chapter Contents

Previous

Next
SAS Component Language: Reference

USECLASS Blocks

USECLASS blocks contain method blocks. A USECLASS block binds the methods that are implemented within it to a class definition. This binding enables you to use the attributes and methods of the class within the methods that are implemented in your USECLASS block. However, your USECLASS block does not have to implement all of the methods defined in the class.

For example, the USECLASS block for the class defined in Defining Classes would be stored in work.a.simMeth.scl and would contain the following code:


USECLASS Block for the addNums Method
useclass simple.class; addNums: public method n1:num n2:num return=num; total=n1+n2; return(total); endmethod; enduseclass;

Using USECLASS blocks to separate the class definition from the method implementations enables multiple programmers to work on method implementations simultaneously.

For more information, see SAS Object-Oriented Programming Concepts; USECLASS -- Level One; and USECLASS.


Chapter Contents

Previous

Next

Top of Page

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