15.8 Inc/Dec operators

The Inc and Dec procedures are – for optimization purposes – compiler intrinsics. They can be overridden in the usual manner by declaring a procedure:

procedure Inc(var s : String);  
 
begin  
  Inc(S,'.');  
end;  
 
procedure Inc(var s : String; T : String);  
 
begin  
 S:=S+T;  
end;

But because they are compiler intrinsics, they can also be implemented as operators for custom types:

operator Inc (s,T : String) : z : string;  
 
begin  
  Z:=S+T;  
end;