> Thanks for suggested code Brad.
>
> The tables are being copied as you surmise.
>
> > Try changing the USED line so that it says:
> >
> >
IF USED(JUSTSTEM(lcNewFilename))
> >
>
> I cannot understand why the following code segment does not work
>
>
>
> Set Default To (mydatapath) && the files to be opened are here
>
> * open dbf
>
> mytable = Juststem(lcNewfilename )
>
> mytablefull = (mytable)+'.dbf'
>
> If File(mytablefull )
>
> If Not Used(mytable)
>
> Use (mytable) In 0 < --- alias() in debugger does not change to this table
>
> Endif
>
> Endif
>
>
>
> Sorry to be so insistent but I am totally confused ...
>
"use myTable In 0" opens the table in the next unused work area - that is, not in the current one.
If you want to have it in the current work area, you can do it the other way around:
If Not Used(mytable)
Select 0
Use (mytable)
Endif
hth
-Stefan