Next;
Next();
The Next method performs transition to the next record in the data source.
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(Null) As 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.
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(Null) As 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: