SET INDEX TOBTW, it's a bad idea to open tables in specific work areas or reference them by workarea number/letter. It makes code very hard to maintain and causes bugs which very hard to track down. You should open tables in the next available are and use alias to reference them. For example
SELECT 0 USE (mxfile4) ALIAS mxfile4 ORDER TAG numbers ... SELECT mxfile4 SET INDEX TO>In my app, I open a table with a structural .cdx file as part of the startup sequence as:
USE (mxfile4) in 4 ORDER TAG numbers.>
cFile = MXTEMPFILES + "temp.idx" >INDEX ON recno + event + seqno + type + notation TO (cFile)>then try to delete the temporary index later,
cFile = MXTEMPFILES + "temp.idx" >IF FILE(cFile) > ERASE (cFile) >ENDIF>I get the 'File is in use' error.
DELETE TAG temp in (cFile)>won't delete the tag.