>Today my way of expression is horrible (not that other days is not) :o)
>You said that SELECT-SQL doesn't use already opened files, but if I run something like SELECT * FROM MyTable INTO CURSOR cTest and then open Data Session window, there is 2 aliases there - MyTable and cTest, but if do something like:
>
>USE MyTable
>SELECT * FROM MyTable INTO CURSOR cTest
>
>and open Data Session window again only 2 aliases are there - MyTable and cTest, there is no addional alias like "B" or "MyTable_B". That is why I think SELECT-SQL uses already opened tables.
If table is not open before a query, VFP'll open it and use in a query. It stays open after query is completed.
If a table is already open, than VFP will open it similar to USE AGAIN with a temp alias and use that alias in a query. The temp aliases are closed after query is completed.
You can see it yourself by creating a simple UDF and running following query (you can use any table instead of 'mytable')
SUSPEND
RETURN "A"
...
SELECT *, myudf() ;
FROM mytable ;
INTO CURSOR temp
Run query twice. First time with mytable claused and second open before query and anylize all workareas in the Datasession window.
--sb--