<!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 face=Arial size=2>It looks as though it's a refresh problem - I'll
try some things and get back to you</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Laurie..</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=marshland@marshland.co.nz
href="mailto:marshland@marshland.co.nz">Marshland Engineering</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=delphi@delphi.org.nz
href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, December 17, 2008 9:17
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [DUG] Bookmark</DIV>
<DIV><BR></DIV>
<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>
<P>
<HR>
<P></P>_______________________________________________<BR>NZ Borland
Developers Group - Delphi mailing list<BR>Post: delphi@delphi.org.nz<BR>Admin:
http://delphi.org.nz/mailman/listinfo/delphi<BR>Unsubscribe: send an email to
delphi-request@delphi.org.nz with Subject: unsubscribe
<P>
<HR>
<P></P><BR>No virus found in this incoming message.<BR>Checked by AVG -
http://www.avg.com <BR>Version: 8.0.176 / Virus Database: 270.9.18/1851 -
Release Date: 12/16/2008 8:53 AM<BR></BLOCKQUOTE></BODY></HTML>