ISequenceInstance.Next

Syntax

Next: Integer;

Description

The Next method generates the next number in sequence.

Example

Executing the example requires a form containing a button named Button 1. Add a link to the Db system assembly. The repository must contain a table of sequence with the PP_SERVICE_LOG_SEQ identifier.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    MB: IMetabase;
    SeqInst: ISequenceInstance;
    key: Integer;
Begin
    MB := MetabaseClass.Active;
    SeqInst := MB.ItemById("PP_SERVICE_LOG_SEQ").Open(NullAs ISequenceInstance;
    key := SeqInst.Next;
    Debug.WriteLine(key);
End Sub Button1OnClick;

After executing the example the console window displays the next number of sequence.

See also:

ISequenceInstance