TZF - Set Carry On - CLONE RECORD
[email protected] Tue, 19 Aug 2003 21:06:23 EDT
| Newsgroups | gmane.comp.lang.delphi.topaz |
|---|---|
| Message-ID | <[email protected]> |
The Topaz Book says you can accomplish the equivalent of
the dBase's "Set Carry On" by not doing a ClearRecord before
the AppendRec.
This implies to me that if you find a record you want to clone, then
do an AppendRec - you will have that record in the database twice.
Do it again, and it will be three times, etc etc.
This does not work, as far as I can tell. Rather than repeat the
record you are on, successive AppendRec will repeat record
number 1 in the database. I have altered the code to include
a Skip(0), which did not help. Then I decided it should
not be indexed, and altered it ... this did not help either.
My present code (not working) looks like this:
____________________________________________________
procedure TfrmProduct.btnCloneMasterClick(Sender: TObject);
var
oldRec, newRec: longInt;
begin
// enter this procedure with a click of CLONE RECORD button which is
// on the form with a TzGrid
// Use TzGrid to find record to clone, then click CLONE RECORD
with DM.DBF_Master do
begin
oldRec:=RecNo;
SetIndexTo('');
Go(oldRec);
SKIP(0);
AppendRec; // ALWAYS clones the first record in the database
Go(oldRec);
IndexOn('validity+time','J_M_NDX');
Go(oldRec);
end;
end;
_____________________________________________________
Can anyone explain this to me? Or is it a bug in the Topaz software?
Thanks for any help,
Bob Watson
--^----------------------------------------------------------------
This email was sent to: [email protected]
EASY UNSUBSCRIBE click here: http://topica.com/u/?clvXPN.a5kvff.Z2NsZHQt
Or send an email to: [email protected]
TOPICA - Start your own email discussion group. FREE!
http://www.topica.com/partner/tag02/create/index2.html
--^----------------------------------------------------------------