>i am using something like this >select a >use filename >set index to >commands >(but right here i want to close it)
OK, but you still shouldn't do the SELECT a.
Try it this way:
SELECT0&& SELECTS next available workareaUSE filename && This will give a default alias of "filename"SETINDEXTO ...
commands...
USEIN filename && this will close your file no matter what the current workarea is