Yea, I knew I would need to rewrite it because the function causes a whole-index.
I like the example you have above but the second lookup causes an issue doesn't it?
repeat i = 1 to num-entries(var1,","):
FOR EACH tbl1 NO-LOCK WHERE tbl1.fld1 = entry(i,var1,","):
do x = 1 to...