USE table1 DO WHILE NOT EOF() m.divi = table1.divi DO WHILE m.divi = table1.divi AND NOT EOF() SKIP ENDDO IF NOT EOF() INSERT BEFORE BLANK SKIP ENDIF ENDDOWhile the above code does (I think) what you asked for, I suggest you seriously rethink whatever it is you are trying to do that wants you to physically place a blank record before each change of divi. Putting any sort of index on divi will cause these blank records to move elsewhere in the ordered table. In addition, each time you INSERT BLANK BEFORE you are making a full copy of the table to insert the blank record. On large tables, this is hideously inefficient. While I don't know exactly what you need to get done, I'm sure there must be a better way than this to do it.
>use table1 >m.divi=divi >scan >if m.divi<>divi >append blank >endif >endscan >***************************** >ex.... > >field name is divi > a > a > a >---------------------->new record > bb > bb >---------------------> new record > sss > sss > . > . >>thanks.