Hello Kanganip
A simple way is to have a single record "SystemNumbers" file with fields for the various number sequences you require , so field for "InvoiceNo" another for "OrderNo" etc
When you need to provide a new Invoice number
Hreadfirst(SystemNumbers)
Lock the record
SystemNumbers.InvoiceNo ++
HModify("SystemNumbers")
Unlock the record
Regards
Al