Processing performance has increased tremendiously. But one another issue has been created.
Since the file size or Data is too huge sorting records by RECNO() in a cursor is taking a long time.
In other words my processing time has decreased but the time taken for builting a Cursor using RECNO() as sort key and again at the end ordering it in sorkey takes a lot time.
Ultimaltely the effective time of entire process has not significantly decreased, though after creation of cursor the process is very very fast.
>Harsh
>
>I was mistaken. Rich is correct. You must never use INSERT BLANK. His idea to use decimals is excellent.
>>Thanks to All of you
>>
>>seems that the Insert Command is making the process Delay. I got the logic you suggested.
>>
>>Regards
>>Harsh
>>
>>
>>
>>>>Performance Increased a Lot particularily by Using
>>>>
>>>>IF MOD(lnCount, 100) = 0
>>>>WAIT WINDOW 'Remaining Records...'+ALLTRIM(STR(RECNO())) NOWAIT
>>>>ENDIF
>>>>
>>>>However this line is inserting records at the bottom of file and not below the required record so I have kept my original code there
>>>>
>>>>INSERT INTO BillFile (POS) VALUES (cTexttwo)
>>>>
>>>>Any suggestion , Please Intimate
>>>>
>>>>Harsh
>>>
>>>The old INSERT command has been deprecated in VFP (meaning it is still there but it isn't recommended that you use it).
>>>
>>>If I remember correctly, that's because it needs to rebuild the file each time you do the insert command. For small files, the processing time is negligible and doesn't have a material impact on performance. But, the bigger the file, the longer each iteration takes and you reach a point where the system slows to a crawl.
>>>
>>>I would suggest something like
>>>SELECT *,000000000.0000 as SortKey FROM billfile INTO CURSOR billfile2 READWRITE
>>>REPLACE ALL sortkey WITH recno() IN billfile2
>>>lnInsertnum = 0.0000
>>>
>>>** Do your code and when you come to the point where you want to do the insert
>>>
>>>
lnInsertnum = lnInsertnum + .0001
>>>lnSortKey = sortKey + lnInsertNum
>>>
>>>INSERT INTO billfile2 VALUES ( < all the insert values >,lnSortKey)
>>>
>>>** finish your code.
>>>
>>>At the end you can
>>>
SELECT < all the fields except sortkey > FROM billfile2 ORDER BY sortkey INTO CURSOR billfile READWRITE
>>>
>>>and I would expect the records to be in the sequence you want. If the way I've expressed it isn't clear, maybe somebody can explain it better.
>>>
>>>........Rich
Harsh