Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do While
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00670004
Message ID:
00670142
Views:
21
In addition Chris told you..

Why don't you use SCAN ... ENDSCAN loops? It gets you automatic selection & skip.


select "tabla_to_be_scanned"
SCAN
mclaim_no = paylisttotal.claim_no
mclaim_pay = paylisttotal.amt_paid

IF mclaim_no <> 0
SELECT (feesubmit+feesubmit1+feesubmit2+feesubmit3+;
feesubmit4+feesubmit5+feesubmit6) as fee_billed;
from services ;
into cursor CurrentClaim nofilter ;
where services.claim_no = mclaim_no

Update services set services.amt_paid = mclaim_pay ,;
services.paid_date = date() ,;
services.close_rec = "YES" ;
where services.claim_no = mclaim_no
IF mclaim_pay = CurrentClaim.Fee_Billed
UPDATE services set services.paid = "YES",;
services.closeclaim = "YES",;
services.closedate = DATE();
WHERE services.claim_no = mclaim_no
ENDIF
ENDIF
mclaim_no = 0
mclaim_pay = 0

ENDSCAN



>Make sure you are getting back onto the right alias before the SKIP

>SELECT blah
>SKIP
...

>>Hi All:
>>
>>Here is a do While loop that I have. The problem is that it exits after the first iteration itself.
>>>
>>

>>do while not eof()
>> mclaim_no = paylisttotal.claim_no
>> mclaim_pay = paylisttotal.amt_paid
>>
>> IF mclaim_no <> 0
>> SELECT (feesubmit+feesubmit1+feesubmit2+feesubmit3+;
>> feesubmit4+feesubmit5+feesubmit6) as fee_billed;
>> from services ;
>> into cursor CurrentClaim nofilter ;
>> where services.claim_no = mclaim_no
>>
>> Update services set services.amt_paid = mclaim_pay ,;
>> services.paid_date = date() ,;
>> services.close_rec = "YES" ;
>> where services.claim_no = mclaim_no
>> IF mclaim_pay = CurrentClaim.Fee_Billed
>> UPDATE services set services.paid = "YES",;
>> services.closeclaim = "YES",;
>> services.closedate = DATE();
>> WHERE services.claim_no = mclaim_no
>> ENDIF
>> ENDIF
>> mclaim_no = 0
>> mclaim_pay = 0
>>
>> SKIP
>> if eof()
>> exit
>> else
>> loop
>> endif
>>ENDDO

>>
>>
>>Where am I going wrong? Thanks in advance.>
Apoya a Visual FoxPro usandolo legalmente
--
¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º
Espartaco Palma Martínez
SysOp PortalFox
http://www.portalfox.com
esparta@portalfox.com
Previous
Reply
Map
View

Click here to load this message in the networking platform