19-12-2008, 08:38 PM
هكذا ربما زاد تحسنا . 

PHP كود :
procedure TForm1.table1CalcFields(DataSet: TDataSet);
var
i:Integer;
begin
i:=(DataSet.RecNo);
if (i <10) then
Table1['Code_Matier']:='Ar000'+inttostr(Dataset.RecNo);
if (i >=10) and (i<100) then
Table1['Code_Matier']:='Ar00'+inttostr(Dataset.RecNo);
if (i >=100) and (i<1000) then
Table1['Code_Matier']:='Ar0'+inttostr(Dataset.RecNo);
if (i >=1000) then
Table1['Code_Matier']:='Ar'+inttostr(Dataset.RecNo);
end;

