Hi,
I'm trying to modify duplicate entries in a Visual Foxpro standalone DBF Table, and the simplest/most efficient way I could conceive is not working. Here is the code:
Everything within the scan seems to work, but when the program reaches endscan for the first time, it breaks the scan without any errors. If I comment out the COUNT line it cycles through just fine, but obviously doesn't function as I need it to.
Is there a way to fix this, or does anyone know of an efficient workaround? I'm trying to avoid nested loops as I'm working with pretty massive tables, and I don't want to just sort by userid then store the previous one, as there can be multiple duplicates and I'm not just adding an incrementing number.
Thanks!
I'm trying to modify duplicate entries in a Visual Foxpro standalone DBF Table, and the simplest/most efficient way I could conceive is not working. Here is the code:
Code:
select tablename
scan
tempid = userid
COUNT TO tjz FOR tempid $ tablename
if tjz > 1
replace userid with fixid(userid)
endif
endscan
Everything within the scan seems to work, but when the program reaches endscan for the first time, it breaks the scan without any errors. If I comment out the COUNT line it cycles through just fine, but obviously doesn't function as I need it to.
Is there a way to fix this, or does anyone know of an efficient workaround? I'm trying to avoid nested loops as I'm working with pretty massive tables, and I don't want to just sort by userid then store the previous one, as there can be multiple duplicates and I'm not just adding an incrementing number.
Thanks!