IDatasetInstance.Next

Fore Syntax

Next;

Fore.NET Syntax

Next();

Description

The Next method performs transition to the next record in the data source.

Fore example

Execution of the example requires a table with the T_Data identifier in the repository with a field with the Value identifier. Add links to the Db and Metabase system assemblies.

Sub UserSample;
Var
    MB: IMetabase;
    DSInst: IDatasetInstance;
    Fields: IDatasetInstanceFields;
    Field: IDatasetInstanceField;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    DSInst := MB.ItemById("T_Data").Open(NullAs IDatasetInstance;
    Fields := DSInst.Fields;
    Field := Fields.FindById("Value");
    While Not DSInst.Eof Do
        i := i + 1;
        Debug.WriteLine("Number: " + i.ToString + "; Value: " + Field.Value);
        DSInst.Next;
    End While;
End Sub UserSample;

After executing the example, the "i" variable contains the number of data source records. The number of fields and values of the Value field are displayed in the console of the development environment.

Fore.NET example

Requirements and result of Fore.NET execution match Fore example.

Imports Prognoz.Platform.Interop.Db;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    DSInst: IDatasetInstance;
    Fields: IDatasetInstanceFields;
    Field: IDatasetInstanceField;
    i: Integer;
Begin
    MB := Params.Metabase;
    DSInst := MB.ItemById["T_Data"].Open(NullAs IDatasetInstance;
    Fields := DSInst.Fields;
    Field := Fields.FindById("Value");
    While Not DSInst.Eof() Do
        i := i + 1;
        System.Diagnostics.Debug.WriteLine("Number: " + i.ToString() + "; Value: " + Field.Value);
        DSInst.Next();
    End While;
End Sub;

See also:

IDatasetInstance