Try the "Try Catch" technique
Try
set order to sometag in 'somealias'
catch to loerr
if loerr.ErrorNo = 1683 or loerr.ErrNo = 2198
select somealias
index on someexpression tag some tagname
else
throw
endif
Finally
....
Glenn
>Hi Naomi,
>
>Yeah I know exactly where the error is coming from. I'm just wondering if it's better if we "hard code" the setting of the index tag. What I did with my programs, is to just create the tag by modifying the structrure of the table from the command window and creating the tag there.
>
>My programs are working well but I will get calls from my users regarding that error every now and then.
>
>Thanks!