appstartcounter Counter property
Example
Return to Introduction  Previous page  Next page
Applies to
acAppStartCounter component.  

Declaration
property Counter: Integer; // read-only!  

Description
The Counter is the read-only property which determines the number of restarts of current application. This variable is increased on each program startup.  
 
Read the Counter to found how many times the application was executed. If the program started for the first time — this value will be 1.  
 
tip To determinate the date and time when program was first time executed — read InstallTime property. To reset the counter to 0 and clear InstallTime value from registry — call ResetCounter method.  

Example
procedure TMainForm.FormCreate(Sender: TObject);  
begin  
  if acAppStartCounter1.Counter = 1 then  
    acAppAutoRun1.AutoRun := True;  
end;  

See also
InstallTime and LifeTime properties;  
ResetCounter method;  
OnFirstStart event.