Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scan / Endscan and processing logic
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Scan / Endscan and processing logic
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01127322
Message ID:
01127322
Views:
64
Hi everybody,

I'm thinking is it possible to utilize one Scan/endscan for my processing logic or should I do it as I do right now repeating some logic after the scan.

I'm processing a cursor. For each different carrier or different client I need to create an Excel file. So, bellow is my current logic
select curProcess
lcCarrier_Name = curProcess.cCarrier_Name
lcHospital = curProcess.cClient_Hospital_Name
lcFolder = alltrim(curProcess.cHospital_Folder)
scan
    if not empty(.cError) or .lStopProcess
	exit
    endif
    lcTrans_pk = curProcess.cTrans_pk
    if not isnull(curProcess.cResolution_Codes_fk)
&& for resolved accounts
       update Scheduled_Processes set iStatus_Flag = 5, ;
	tDate_process_updated = datetime() ;
	where cTrans_fk = m.lcTrans_pk ;
	and cProcess_Name_fk = m.lcBatch_Processes_Fk and ;
	iStatus_Flag < 4
    else						
	if not m.lcCarrier_Name == curProcess.cCarrier_Name ;
	or not m.lcHospital == curProcess.cClient_Hospital_Name
	   lcFileName = forceext(m.lcDate + "_" + ;
	    m.lcFolder + "_" + ;
	    strtran(alltrim(m.lcCarrier_Name)," ",""),'xls')
*****
endscan
and then I repeat the code of creating Excel and some other relevant code right after the scan to finish with the last carrier and client.

I'm trying to figure out, if I somehow can adjust the logic to avoid this repetition.

Thanks in advance for your ideas.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform