LOCAL lcPSFILEPATH, lcNEWPATH Select NEW_BILLS Scan && Scans for New_bills up to EOF() lcPSFILEPATH=Alltrim(NEW_BILLS.oldpath) lcNEWPATH=Alltrim(NEW_BILLS.NEWPATH) DO Compress with m.lcPSFILEPATH, m.lcNEWPATH ENDSCANUse LPARAMETERS not PARAMETERS
PROCEDURE Compress LPARAMETERS m.tcPSFILEPATH,m.tcNEWPATH Create Cursor BILLCOMPRESS (POS C(254)) && Create Temporary Cursor Billcompress to Check Page Numbers,Compressed File and Invoice Date. Select BILLCOMPRESS WAIT WINDOW m.tcPSFILEPATH WAIT WINDOW m.tcNEWPATH Append From (m.tcPSFILEPATH) Sdf && Nothing is appeneded as I get .F. as value for m.tcPSFILEPATH ENDPROCBUT - I would have created cursor billcompress in the calling code. Your compress routine is not doing anything significant yet. It will be slow. The cursor is destroyed and recreated as the scan runs. This is what I have been asking you to do. Explain what you want to do then we can show you a more complete example which will be fast, efficient. The append from is not really part of the work of compressing the sdf.
LOCAL m.lcPSFILEPATH, m.lcNEWPATH Create Cursor BILLCOMPRESS (POS C(254)) && Create Temporary Cursor Billcompress to Check Page Numbers,Compressed File and Invoice Date. Select NEW_BILLS Scan lcPSFILEPATH=Alltrim(NEW_BILLS.oldpath) lcNEWPATH=Alltrim(NEW_BILLS.NEWPATH) SELECT BILLCOMPRESS Append From (m.lcPSFILEPATH) Sdf DO Compress with m.lcPSFILEPATH, "BILLCOMPRESS", RECNO("BILLCOMPRESS") ENDSCAN PROCEDURE Compress LPARAMETERS m.tcPSFILEPATH, m.tcAlias, m.tnRec SELECT (m.tcAlias) GO m.tnRec *Process the POS field. ENDPROCOR!
LOCAL m.lcPSFILEPATH, m.lcNEWPATH Create Cursor BILLCOMPRESS (POS C(254)) && Create Temporary Cursor Billcompress to Check Page Numbers,Compressed File and Invoice Date. Select NEW_BILLS Scan lcPSFILEPATH=Alltrim(NEW_BILLS.oldpath) lcNEWPATH=Alltrim(NEW_BILLS.NEWPATH) SELECT BILLCOMPRESS Append From (m.lcPSFILEPATH) Sdf ENDSCAN DO Compress with m.lcPSFILEPATH, "BILLCOMPRESS" PROCEDURE Compress LPARAMETERS m.tcPSFILEPATH, m.tcAlias SELECT (m.tcAlias) SCAN *Process the POS field. ENDSCAN ENDPROC>I am using the following code. I am not getting the value for cPSFILEPATH,cNEWPATH in my compress procedure. Instead I am getting .F.
>Select NEW_BILLS >LOCAL cPSFILEPATH as Character >LOCAL cNEWPATH as Character > >Scan && Scans for New_bills up to EOF() >*Define Variables >cPSFILEPATH=Alltrim(oldpath) >cNEWPATH=Alltrim(NEWPATH) >DO Compress >ENDSCAN > >PROCEDURE Compress >PARAMETERS cPSFILEPATH,cNEWPATH >Create Cursor BILLCOMPRESS (POS C(254)) && Create Temporary Cursor Billcompress to Check Page Numbers,Compressed File and Invoice Date. >Select BILLCOMPRESS >WAIT WINDOW cPSFILEPATH >WAIT WINDOW cNEWPATH >Append From (m.cPSFILEPATH) Sdf && Nothing is appeneded as I get .F. as value for cPSFILEPATH >ENDPROC > >