(******************************************************************************
*                                SHARE31 .DEF                                  *
*                              ABO Software Dep.                              *
* Purpose : TO provide a simple database OF share details                     *
*                                                                             *
*   Notes :                                                                   *
*                                                                             *
*         Version Date : 10/6/92                                              *
******************************************************************************)
DEFINITION MODULE SHARE31;

FROM DATA21 IMPORT DBase,Tuple,TuplePtr;
FROM DATE11 IMPORT Date;
FROM OBJ11 IMPORT Object;
FROM FIO IMPORT File;
CONST

TYPE
	CompType = ARRAY[0..4]OF CHAR;
	String  = ARRAY[0..32]OF CHAR;
	SharePtr = POINTER TO Share;
	TransactPtr = POINTER TO Transact;
	GainPtr	= POINTER TO Gain;

CLASS Share(Date);
	comp:CompType;
	note:String;
VIRTUAL PROCEDURE compeq(VAR t:Share):BOOLEAN ;
VIRTUAL PROCEDURE complt(VAR t:Share):BOOLEAN ;
VIRTUAL PROCEDURE compgt(VAR t:Share):BOOLEAN ;
VIRTUAL PROCEDURE clear;
VIRTUAL PROCEDURE copy(VAR o:Object);
VIRTUAL PROCEDURE add(VAR t1,t2:Share);
VIRTUAL PROCEDURE rd(f:File);
VIRTUAL PROCEDURE wr(f:File);
END Share;


CLASS ShareDB(DBase);
PROCEDURE compfind(VAR cp:Share):SharePtr;
PROCEDURE compselecteq(VAR cp:Share;VAR db:ShareDB);
PROCEDURE compselectne(VAR cp:Share;VAR db:ShareDB);
PROCEDURE sum(VAR tp:Share);
END ShareDB;


CLASS Dividend(Share);
	unfrank,franked,imputed:REAL;
VIRTUAL PROCEDURE clear;
VIRTUAL PROCEDURE copy(VAR o:Object);
VIRTUAL PROCEDURE add(VAR t1,t2:Share);
VIRTUAL PROCEDURE rd(f:File);
VIRTUAL PROCEDURE wr(f:File);
END Dividend;


CLASS Transact(Share);
	number:INTEGER;
	cost,broker,stamp:REAL;
PROCEDURE create(no:INTEGER;VAR tr:Transact);
VIRTUAL PROCEDURE clear;
VIRTUAL PROCEDURE copy(VAR o:Object);
VIRTUAL PROCEDURE add(VAR t1,t2:Share);
VIRTUAL PROCEDURE rd(f:File);
VIRTUAL PROCEDURE wr(f:File);
END Transact;


CLASS Gain(Share);
	purchase:Date;
	number:INTEGER;
	received,cost,aquired,disposed,index,base,indexed,taxed:REAL;
PROCEDURE create(no:INTEGER;VAR tr1,tr2:Transact);
VIRTUAL PROCEDURE clear;
VIRTUAL PROCEDURE copy(VAR o:Object);
VIRTUAL PROCEDURE add(VAR t1,t2:Share);
VIRTUAL PROCEDURE wr(f:File);
END Gain;


VAR
	taxdate:Date;

END SHARE31.