<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16762" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>I have a strange problem. I have a dbgrid and am moving
records up and down with buttons. (Delphi4)</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>The routine works </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>If I uncomment the bookmark, it displays wrong figures in
the seq and seq2 columns on the record I was moving.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>If I move a line and close the application, reopen
it, the figures are correct. It seem that only the display is incorrect
when moving.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>SEQ SEQ2 Desc</FONT></DIV>
<DIV><FONT size=2>20
20 Tool Select</FONT></DIV>
<DIV><FONT size=2>25 25
Coolant on</FONT></DIV>
<DIV><FONT size=2>30
30 Feed Rate</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>If I move "Coolant on" down I get </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>
<DIV><FONT size=2>20
20 Tool Select</FONT></DIV>
<DIV><FONT size=2>30
30 Coolant on</FONT></DIV>
<DIV><FONT size=2>25
25 Feed Rate</FONT></DIV>
<DIV><FONT
size=2>30 30 Coolant
on</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Close the application and reopen</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>20
20 Tool Select</FONT></DIV>
<DIV><FONT
size=2>25 25
Feed Rate</FONT></DIV>
<DIV><FONT
size=2>30 30
Coolant on</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>If I comment out the Bookmark, it works correctly but
leaves me at the bottom of the list. </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV></DIV>
<DIV><FONT size=2>procedure OperSort(sBM: String);<BR>var<BR> iSeq :
Integer;<BR>begin<BR> with dm.tblOper do
begin<BR> IndexName :=
'OPERSEQ2'; // Swop
to this new sort order<BR>
Open;<BR>
First;
// go to the top<BR>
iSeq:=5;
// first record is 5<BR> while not Eof do
begin<BR>
edit;<BR> dm.tblOper['SEQ']:=
iSeq; // increase each recod by
5<BR>
iSeq:=iSeq+5;<BR>
dm.tblOper.post;<BR>
dm.tblOper.next;<BR>
end;<BR> close;<BR>
IndexName :=
'OPERSEQ'; //
set back to the original order<BR>
Open;<BR> First;<BR>
while not Eof do begin<BR>
edit;<BR> dm.tblOper['SEQ2']:=
dm.tblOper['SEQ']; // Update secondary index.
<BR>
Post;<BR>
Next;<BR> end;<BR>
// BookMark:=sBM;<BR> end;<BR>end;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>procedure TfMain.bMainDownClick(Sender:
TObject);<BR>var<BR> iSeq: Integer;<BR> sBookMark
:String;<BR>begin<BR>
iSeq:=dm.tblOper.FieldByName('SEQ').AsInteger; //get the current sequence
number<BR> with dm.tblOper do
begin<BR>
iSeq:=iSeq+6;
// Increase by 6<BR>
edit;
// tbl seq numbers are multiple of 5's<BR>
dm.tblOper['SEQ2']:= iSeq;<BR>
Post;<BR> sBookMark:=
BookMark;
// Position Cursor at current
record.<BR>
Close;<BR> OperSort(sBookMark);<BR>
end;<BR>end;</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV></BODY></HTML>