Hi Mike, Either of the following will do the job.
The main part is the FormatFloat(#00,Int1) bit, function AddLeadingZeros(const S1,S2,S3 : String; Int1 : Integer) :String; begin // AB-CDE-FG1-999 // S1 S2 S3 Int1 Result := S1 + S2 + S3 + FormatFloat(#00,Int1); end; function AddLeadingZeros(var Int1 : Integer) :String; begin Int1 := Int1 + 1; Result := 'AB-CDE-FG1-' + FormatFloat(#00,Int1); end; Kind regards Grant Brown Mike Lucek wrote: >Does any one have a function that allows the incrementing of a number with >leading zeros expressed as a string. For example, I have a string >AB-CDE-FG1-003, I want to increment that string to AB-CDE-FG1-004, or 005 >and so on. The maximum incremental value would be AB-CDE-FG1-999. Any >suggestions would be appreciated. > >Mike > >_______________________________________________ >Delphi mailing list -> [email protected] >http://www.elists.org/mailman/listinfo/delphi > > > _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

