A very handy xBase expression to know is the COUNTER() function.
When you invoke the COUNTER, it returns a sequential number based upon the parameters you give it. This is typically used to provide a sequential Customer Number for Contact Records.
Let's put a Counter in a Field Lookup window for easy access.
1. Bring up the Field Lookup window for the field you wish to modify.
2. Hit "New" to create a new Picklist item.
3. Paste in the following text: ~COUNTER("CustNum",1,1)
4. Hit ok.
Now, when you select this item from the picklist, it will generate the next number in sequence, starting at "1". Try it!
The first parameter is the name of our counter. This can be whatever we want. ("MyCounter").
The second parameter defines how large our increment should be. A value of 1 increments by 1, a value of 10 increments by 10.
The third parameter specifies where our counter should start. Typically this is set to 0, however, if a numbering scheme is already in place, this can help generate the right numbers for your sequence.