| Class TCountTable (unit CntTable) |
TTable
**********************************} { TCountTable = class(TTable) } { Giovanni Burzomato } { Luigi Menghini } { e-mail : lume@tn.village.it } {
| Constructors |
| Functions |
Procedure CreateTable;add the suffix '_NO'
Procedure Open;
procedure DoBeforeEdit;
procedure DoBeforePost;
function BuildAutoFieldName : string;
function BuildMAXFileName : string;build the name of the file .
Function ReadIncCounter : Boolean;looks for the file .
| Properties |
| Events |
| Variables |
FAutoFieldName : string;
FContaRecords : LongInt;
FCurrCountStr : string;
FMaxFileName : string;| Constructors |
| Functions |
Procedure CreateTable;if FAutoFieldName <> '' save the current value in FCurrCountStr
add the suffix '_NO'
Procedure Open;first TCountTable.Open looks for the file FileName.MAX } { if it doesn't exist rebuild it.
procedure DoBeforeEdit;If the xxx_NO field exists save the current value into FCurrCountStr
procedure DoBeforePost;ReadIncCounter verify if exists the file TableName.MAX
in case of a Client/Server application tries to open exclusive } { the .MAX file.
function BuildAutoFieldName : string;name of the file counter TableName.MAX
function BuildMAXFileName : string;BuildAutoFieldName build the name of the autoincresing field
build the name of the file .MAX
Function ReadIncCounter : Boolean;BuildMAXFileName build FMaxFileName
looks for the file .MAX
| Properties |
| Events |
| Variables |
FAutoFieldName : string;internal counter set to 0 at CreateTable
FContaRecords : LongInt;
FCurrCountStr : string;name of the autoincreasing field
FMaxFileName : string;FCurrCountStr save the current value of the autoincreasing field } { if state is dsEdit to overwrite it at DoBeforeEdit.