> > > 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?
>
> Let me clarify a bit more, I added a
SELECT C_first
right before the skip and it does go to the next record but then
SELECT a_tmpf1
gives a cannot find alias error after a random amount of records. I hate these kind of intermittant errors.
If you use SCAN ALL ENDSCAN you shouldn't have the problem.
KTB