| Class TCounterLink (unit DBCountr) |
TDataLink
| Constructors |
| Functions |
procedure ActiveChanged;
procedure AssignNextNumber;
procedure CounterBeforePost(DataSet: TDataSet);
procedure CounterOnPostError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);
function NextNumber: TCounter;
procedure SetTable(obj: TTable);| Properties |
property CounterField : string
property CounterValue : TCounter
property GetMaxValMethod : TGetMaxValMethod
property MaxLockRetry : TMaxLockRetry
property Table : TTable| Events |
| Variables |
CounterFieldObj : TField;
CounterFile : string;
FCounterField : string;
FCounterValue : TCounter;
FGetMaxValMethod : TGetMaxValMethod;
FirstActivation : boolean;
FMaxLockRetry : TMaxLockRetry;
FTable : TTable;
PostRetried : boolean;
TableBeforePost : TDataSetNotifyEvent;
TableOnPostError : TDataSetErrorEvent;| Constructors |
| Functions |
procedure ActiveChanged;//////////////// // TCounterLink // ////////////////
procedure AssignNextNumber;Version 1.103 - restore table's BeforePost method
procedure CounterBeforePost(DataSet: TDataSet);Version 1.103 - new method
procedure CounterOnPostError(DataSet: TDataSet; E: EDatabaseError;
var Action: TDataAction);Version 1.103 - this method replaces UpdateData method as it will only be called when necessary. I didn't realise UpdateData is called so often - the counter value was being incremented each time and many values were being wasted. Now, only one new value is used per post, unless CounterOnPostError is triggered.
function NextNumber: TCounter;Version 1.103 - AssignNextNumber replaces call to UpdateData
procedure SetTable(obj: TTable);OpenCounterFile} {NextNumber
| Properties |
property CounterField : string
property CounterValue : TCounter
property GetMaxValMethod : TGetMaxValMethod
property MaxLockRetry : TMaxLockRetry
property Table : TTable| Events |
| Variables |
CounterFieldObj : TField;
CounterFile : string;
FCounterField : string;
FCounterValue : TCounter;
FGetMaxValMethod : TGetMaxValMethod;
FirstActivation : boolean;
FMaxLockRetry : TMaxLockRetry;
FTable : TTable;
PostRetried : boolean;
TableBeforePost : TDataSetNotifyEvent;
TableOnPostError : TDataSetErrorEvent;