Class TSeatChecker (unit Sccomps)

Inherits from

TComponent

TMethod defines the two methods of software licensing -- by user (seat- } { based) or by total number of users (concurrent use-based).

Constructors


constructor Create(AOwner : TComponent);

Public declarations

TSeatChecker



Functions

procedure SitDown;

if-then

procedure StandUp;

Finally, record the current status

procedure EmptyLurchTable;

Protected declarations

Make sure that a seat is not being held first.


procedure SetDBName(value : TFileName);

initialize Status to be standing (i.

procedure SetMethod(value : TMethod);

Depending on the value of Value, call the SitDown or the StandUp method.

procedure SetStatus(value : TStatus);

This is your basic property access method.

Properties

property DatabaseName : TFileName

Published declarations

property Method : TMethod

Username is the name of the user checking for a seat.

property Status : TStatus

DatabaseName is the name of the application database.

property UserName : String

Status indicates whether the application holds a seat or not.

Events

Variables

fDBName : TFileName;

Private declarations

fLurchTbl : TTable;


fMethod : TMethod;


fStatus : TStatus;


fUserName : String;



Constructors


constructor Create(AOwner : TComponent);

Public declarations

TSeatChecker


Functions


procedure SitDown;

if-then


procedure StandUp;

Finally, record the current status


procedure EmptyLurchTable;

Protected declarations

Make sure that a seat is not being held first.


procedure SetDBName(value : TFileName);

initialize Status to be standing (i.e. not occupying a seat).


procedure SetMethod(value : TMethod);

Depending on the value of Value, call the SitDown or the StandUp method. I do this so that I can test my application in design-mode, i.e. if I want to reserve a seat, I just change the value in the Object Inspector. This is the beauty of component-oriented programming.


procedure SetStatus(value : TStatus);

This is your basic property access method. You may wish to add some extra functionality to it, such as checking to see that a lurch table exists in the specified database, and creating one if it does not.


Properties


property DatabaseName : TFileName

Published declarations


property Method : TMethod

Username is the name of the user checking for a seat.


property Status : TStatus

DatabaseName is the name of the application database. It is important to } { set this to the database being used by the application, otherwise the } { whole purpose of TSeatChecker is defeated.


property UserName : String

Status indicates whether the application holds a seat or not.


Events


Variables


fDBName : TFileName;

Private declarations


fLurchTbl : TTable;


fMethod : TMethod;


fStatus : TStatus;


fUserName : String;