Re: [fpc-pascal] Suggestion: TDataSetEnumerator

2015-03-29 Thread silvioprog
On Tue, Mar 10, 2015 at 5:48 PM, silvioprog wrote: > On Sat, Mar 7, 2015 at 4:27 AM, LacaK wrote: > >> What if TDataSetEnumerator.Current will return TFields instead of >> TDataSet which enumerates? >> >> Example: >> procedure IterateDataSet; >> var DataSet, DS: TDataSet; >> Flds: TFie

Re: [fpc-pascal] Suggestion: TDataSetEnumerator

2015-03-10 Thread silvioprog
On Sat, Mar 7, 2015 at 4:27 AM, LacaK wrote: > What if TDataSetEnumerator.Current will return TFields instead of TDataSet > which enumerates? > > Example: > procedure IterateDataSet; > var DataSet, DS: TDataSet; > Flds: TFields; > F: TField; > begin > for Flds in DataSet do

Re: [fpc-pascal] Suggestion: TDataSetEnumerator

2015-03-06 Thread LacaK
What if TDataSetEnumerator.Current will return TFields instead of TDataSet which enumerates?Example:  procedure IterateDataSet;  var DataSet, DS: TDataSet;      Flds: TFields;      F: TField;  begin    for Flds in DataSet do      for F in Flds do  // DataSet can be still accessed by Flds.DataSet   

Re: [fpc-pascal] Suggestion: TDataSetEnumerator

2015-03-06 Thread Michael Van Canneyt
On Fri, 6 Mar 2015, LacaK wrote: You should check here for unidirectional datasets. They do not support .first. For unidirectional datasets you can only go from the current point forward. AFAIK we support First. We have also test for it. Ah :) Great, in that case no changes are needed.

Re: [fpc-pascal] Suggestion: TDataSetEnumerator

2015-03-06 Thread LacaK
You should check here for unidirectional datasets. They do not support .first. For unidirectional datasets you can only go from the current point forward. AFAIK we support First. We have also test for it. Btw Delphi: "The only supported navigation methods are the First

Re: [fpc-pascal] Suggestion: TDataSetEnumerator

2015-03-06 Thread Michael Van Canneyt
On Thu, 5 Mar 2015, silvioprog wrote: On Thu, Mar 5, 2015 at 6:48 AM, Constantine Yannakopoulos wrote: On Thu, Mar 5, 2015 at 2:11 AM, silvioprog wrote: What do you think about a TDataSetEnumerator class in the DB unit? Something like this: === begin code ===   fun

Re: [fpc-pascal] Suggestion: TDataSetEnumerator

2015-03-05 Thread silvioprog
On Thu, Mar 5, 2015 at 6:48 AM, Constantine Yannakopoulos < alfasud...@gmail.com> wrote: > On Thu, Mar 5, 2015 at 2:11 AM, silvioprog wrote: > >> What do you think about a TDataSetEnumerator class in the DB unit? >> Something like this: >> >> === begin code === >> >> > function TDataSetEnumerator

Re: [fpc-pascal] Suggestion: TDataSetEnumerator

2015-03-05 Thread silvioprog
On Thu, Mar 5, 2015 at 6:15 AM, Michael Van Canneyt wrote: > > On Wed, 4 Mar 2015, silvioprog wrote: > >> Hello, >> What do you think about a TDataSetEnumerator class in the DB unit? >> Something like this: >> > > Good idea. I never implemented it because I didn't know what to return. > But maybe

Re: [fpc-pascal] Suggestion: TDataSetEnumerator

2015-03-05 Thread Constantine Yannakopoulos
On Thu, Mar 5, 2015 at 2:11 AM, silvioprog wrote: > What do you think about a TDataSetEnumerator class in the DB unit? > Something like this: > > === begin code === > > function TDataSetEnumerator.MoveNext: Boolean; > begin > Inc(FPosition); > if FPosition = FDataSet.RecordCount then > Ex

Re: [fpc-pascal] Suggestion: TDataSetEnumerator

2015-03-05 Thread Michael Van Canneyt
On Wed, 4 Mar 2015, silvioprog wrote: Hello, What do you think about a TDataSetEnumerator class in the DB unit? Something like this: Good idea. I never implemented it because I didn't know what to return. But maybe returning the dataset itself is not a bad idea. If you implement it using t

[fpc-pascal] Suggestion: TDataSetEnumerator

2015-03-04 Thread silvioprog
Hello, What do you think about a TDataSetEnumerator class in the DB unit? Something like this: === begin code === TDataSetEnumerator = class private FPosition: Integer; FDataSet: TDataSet; function GetCurrent: TDataSet; public constructor Create(ADataSet: TDataSet); fun