Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: CF
  Where is CF?
 Colmar
 Pennsylvania - Poland
 CF
 To: CF
  Where is CF?
 Colmar
 Pennsylvania - Poland
 CF
 Tags
Subject: RE: DO WHILE in a cursor problem
Thread ID: 21927 Message ID: 21930 # Views: 3 # Ratings: 0
Version: Visual FoxPro 7 Category: General VFP Topics
Date: Friday, April 04, 2003 5:28:19 PM         
   


> Does anyone know why my do while !EOF() loop will only do the first record and then exit even though there are alot more records in the source cursor?
>
>
>   SELECT lineno, sono, item, loctid, qtyord-qtyshp AS qtyord, picked, whmap, RECNO("a") AS recno ;
>     FROM (m0sotranf) a WHERE sono = lc_sono AND sostat=' ' AND sotype$" O" ;
>     ORDER BY 1 INTO CURSOR C_first
> bROW  
>   GO TOP
>   DO WHILE !EOF()  && Will only go through first record then exit
>   	  ln_memcount = MEMLINES(whmap)-1
>   	  *IF ln_memcount > 1
>   	  FOR i = 1 TO ln_memcount
>   	  
>   	    lc_str      = MLINE(whmap, i)
>   	    lc_chkitem  = SUBSTR(lc_str, 1, 15)
>   	    lc_pickloc1 = SUBSTR(lc_str, 16, 6)
>   	    lc_pickq1   = VAL(SUBSTR(lc_str, 22, 5))
>   	    lc_vndid1   = SUBSTR(lc_str, 27, 6)
>   	    lc_pickloc2 = SUBSTR(lc_str, 33, 6)
>   	    lc_pickq2   = VAL(SUBSTR(lc_str, 39, 5))
>   	    lc_vndid2   = SUBSTR(lc_str, 44, 6) 
>     	
>     	SELECT a_tmpf1 
>   	  
>   	    APPEND BLANK
>   	    REPLACE Lineno WITH c_first.lineno, ITEM WITH c_first.item, BOM WITH lc_chkitem, LOCTID WITH c_first.loctid, ;
>   	            QTY WITH c_first.qtyord, pickloc1 WITH lc_pickloc1, pickq1 WITH lc_pickq1, VndID1 WITH lc_vndid1,;
>   	            pickloc2 WITH lc_pickloc2, pickq2 WITH lc_pickq2, VndID2 WITH lc_vndid2
>   	    REPLACE oqty WITH qty, opickloc1 WITH pickloc1, opickq1 WITH pickq1, OVndID1 WITH VndID1;
>   	            opickloc2 WITH pickloc2, opickq2 WITH pickq2, OVndID2 WITH VndID2, recno WITH c_first.recno
>   	
>       ENDFOR
>       *ENDIF
>   SKIP
>   ENDDO
> 

IS it because I have to change back to the original table before the
SKIP
or something to that effect?

COMPLETE THREAD