DESTRUCTOR class-name ( ):
PUBLIC destructor-body END DESTRUCTOR . |
USING acme.myObjs.*.
USING acme.myObjs.Common.*. CLASS acme.myObjs.CustObj INHERITS CommonObj: DEFINE PUBLIC VARIABLE iNumCusts AS INTEGER NO-UNDO. DEFINE PROTECTED TEMP-TABLE ttCustomer NO-UNDO FIELD RecNum AS INTEGER FIELD CustNum LIKE Customer.CustNum FIELD Name LIKE Customer.Name FIELD State AS CHARACTER. DEFINE PRIVATE VARIABLE rCreditObj AS CLASS CreditObj NO-UNDO. DEFINE PRIVATE VARIABLE rMsg AS CLASS MsgObj NO-UNDO. CONSTRUCTOR PUBLIC CustObj ( ): rCreditObj = NEW CreditObj ( ). iNumCusts = 0. /* Fill temp table and get row count */ FOR EACH Customer NO-LOCK WHERE Customer.CreditLimit > 50000: CREATE ttCustomer. ASSIGN iNumCusts = iNumCusts + 1 ttCustomer.RecNum = iNumCusts ttCustomer.CustNum = Customer.CustNum ttCustomer.Name = Customer.Name ttCustomer.State = Customer.State. END. rMsg = MessageHandler("acme.myObjs.CustObj"). END CONSTRUCTOR. ... DESTRUCTOR PUBLIC CustObj( ): EMPTY TEMP-TABLE ttCustomer. END DESTRUCTOR. END CLASS. |