ISequenceInstance.Next

Fore Syntax

Next: Integer;

Fore.NET Syntax

Next(): integer;

Description

The Next method generates the next number in sequence.

Fore 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.

Fore.NET 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.

Imports Prognoz.Platform.Interop.Db;
...
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    MB: IMetabase;
    SeqInst: ISequenceInstance;
    key: Integer;
Begin
    MB := Self.Metabase;
    SeqInst := MB.ItemById["PP_SERVICE_LOG_SEQ"].Open(NullAs ISequenceInstance;
    key := SeqInst.Next();
    System.Diagnostics.Debug.WriteLine(key.ToString());
End Sub;

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

See also:

ISequenceInstance