Edrossi,
Okay, I'll assume you have a table called Address
USE ADDRESS IN 0
COPY STRU TO ADDBREAKS WITH PRODUCTION && retains indexes
USE ADDBREAKS IN 0
SELECT ADDRESS
GO TOP
lnCount = 1
DO WHILE NOT EOF()
SELECT ADDRESS
SCATTER MEMVAR MEMO &&Only need memo clause if you have memo fields
SELECT ADDBREAKS
APPEND BLANK
GATHER MEMVAR
IF lnCount = 200
SELECT ADDBREAKS
APPEND BLANK
REPLACE <fields> WITH '#########'
* Name all fields one, by one with the appropriate name, and assign the number of '#' characters to the field
lnCount = 0
ENDIF
lnCount = lnCount + 1
SELECT ADDRESS
SKIP
ENDDO
Copy this code, alter the table name as needed, and fix the fields, and run it. The good news is this is entierly non-distructive, so if it doesn't work the first time, just ZAP the ADDBREAKS table, and fix the code, run it again. Once you've got it all correct, just rename the table from ADDBREAKS to ADDRESS, and you're good to go. Best Regards,
Scott
"Everything should be made as simple as possible, and no simpler."
SET TALK OFF
USE &vartable
SCAN
IF MOD(RECNO(),200)=0
INSERT blank after
FOR x= 1 to AFIELDS(temparray,vartable)
IF temparray(x,2)="C"
REPLACE (temparray(x,1)) with replicate("#",temparray(x,3))
endif
endfor
ENDIF
ENDSCAN
SET TALK ON
ER,
The biggest problem I see with the above soluitons is that that they only apply to one ordering of the data. If you use any index or sort ordering, and you'll lose this every 20 break.
I must have a mildly different version of VFP to you Brian,
ALL the above commands just do an 'Append blank' - perhaps your index is maintaining the order for you?
Try a native table (no index order set) and run the commands manually for yourself.
No, it doesn't matter where the cursor is, INSERT is included for backwards compatibility only and does an
APPEND - so that with really large tables VFP doesn't have to reshuffle huge numbers of records physically in a table.
If we grant that my solution does work, then there is another difference between the two solutions.
My program included the added row "#####" as a counter record, thus making rows 201, 401, 601 etc. as a "###" row; while Scott's solution does not, thus making rows 201, 402, 603 as a "###" row.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.