Normally you would use SCAN precisely to avoid doing a SKIP after every record (and also avoid checking for EOF()). Since the SCAN automatically does an additional SKIP, and you are also SKIPping, perhaps that is one SKIP too many.
>Hi,
>I've bumped into an interesting thingy. I've used the code snippet below for a long time and it's worked quite well. But today my the MS XP crushed and had to restart the computer. From that time this code snippet stops at the end of the first loop. Interestingly enough, if I exchange the "scan... endscan" to "do while...enddo", it works fine.
>Any idea?
>
>
>SCAN
> lEngkod = ALLTRIM(temp1.engkod)
> lSql = STUFF(lcSelect,AT('"',lcSelect)+1,10,lEngkod)
> &lSql
>
> SELECT temp2
>
> lcTenSuly = 'temp1.ten_suly'
> lcTenTav = 'temp1.ten_tav'
>
> SELECT temp2
> FOR gnCount = 1 TO RECCOUNT()
> lcTenSuly1 = lcTenSuly+ALLTRIM(STR(gnCount))
> lcTenTav1 = lcTenTav+ALLTRIM(STR(gnCount))
> REPLACE &lcTenSuly1 WITH temp2.suly, &lcTenTav1 WITH temp2.Ttav
> SKIP
> ENDFOR
>
>ENDSCAN
>
>
>
>(Anyway, many thanks for the replies about the text wrapping problem from yesterday.)
>
>Tamas
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)