Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Making a copy of a cursor with a range
Thu, Nov 2 2006 12:51 PMPermanent Link

Sean McCall
Tim,

Is there a way to creating second TDBISAMTable cursor that is an exact
duplicate of another including any range? I can get the table info & the
filters copied, but don't know how to copy the range.

Something like:

function CloneCursor(ATable: TDBISAMTable): TDBISAMTable;

begin
  Result := TDBISAMTable.Create(ATable.Owner);
  Result.TableName := ATable.TableName;
  Result.DatabaseName := ATable.DatabaseName;
  Result.Filter := ATable.Filter;
  Result.Filtered := ATable.Filtered;

  (*
  HOW DO I COPY THE RANGE?
  *)
end;

Or will I have to keep track of the range I set in the first table &
then reproduce it when I make the cloned cursor?

Thanks,

Sean
Thu, Nov 2 2006 11:01 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sean,

<< Is there a way to creating second TDBISAMTable cursor that is an exact
duplicate of another including any range? I can get the table info & the
filters copied, but don't know how to copy the range. >>

You could try using EditRangeStart and EditRangeEnd - they will give you
FieldByName() access to the fields that are assigned values in the current
range.  You'll have to then go ahead an call ApplyRange again to keep the
existing range set, but that may or may not matter.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Nov 3 2006 9:37 AMPermanent Link

Sean McCall
Tim,

Will the ApplyRange call change the record position in the dataset? For
that matter, does apply range always automatically move the cursor to
the first record of the range?

Thanks,

Sean

Tim Young [Elevate Software] wrote:
> Sean,
>
> << Is there a way to creating second TDBISAMTable cursor that is an exact
> duplicate of another including any range? I can get the table info & the
> filters copied, but don't know how to copy the range. >>
>
> You could try using EditRangeStart and EditRangeEnd - they will give you
> FieldByName() access to the fields that are assigned values in the current
> range.  You'll have to then go ahead an call ApplyRange again to keep the
> existing range set, but that may or may not matter.
>
Fri, Nov 3 2006 7:13 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sean,

<< Will the ApplyRange call change the record position in the dataset? >>

Possibly.

<< For that matter, does apply range always automatically move the cursor to
the first record of the range? >>

Yes.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image