I have a method that creates record numbers using the Sequence number. I'm running into a situation where I am getting duplicate record numbers for some reason. So I added some code to check and - supposedly - fix it by resetting the table sequence number, but it doesn't seem to work.
This is what I'm doing: $Sequence:=*Sequence number*(*Table*($iTableNumber)->) *If* (*Find in field*(*$1*->;$Sequence)>-1) // $1 is a pointer to the record number field *While* (*Find in field*(*$1*->;$Sequence)>-1) $Sequence:=$Sequence+1 *End while* *SET DATABASE PARAMETER*(*Table*($iTableNumber)->;Table sequence number; $Sequence) *End if* *$1*->:=*Sequence number*(*Table*($iTableNumber)->) Suppose $Sequence = 4496 when we get to the SET DATABASE PARAMETER line. Then the next call to *Sequence number* should return 4497, right? But it doesn't. It returns 4495. Any suggestions as to what I'm doing wrong here? Note- this is not happening inside a transaction. Pat -- ************************************************* CatBase - Top Dog in Data Publishing tel: +44 (0) 207 118 7889 w: http://www.catbase.com skype: pat.bensky ************************************************* ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

