Subject Re: accessing the dbase table opened automatically
From Bruce Beacham <bbeacham@no-plm-lowman.co.uk>
Date Thu, 20 Feb 2014 10:35:04 +0000
Newsgroups dbase.getting-started

> use "c:\some\dir\table.dbf"

Now it's opened by PLUS with an sql tool.

> simple way to switch to the table that is already being displayed
> without having to type the name again or selecting it in the file
> open dialog?

Try the function below.


Bruce Beacham

**********************
* GrabBrowse.prg
* Catches the table that was opened in an instance of PLUS
*  by double-clicking on a table in Windows Explorer.
* Sets the query as _app.q.
* Reports the tablename.
* Returns the query.
* Opens the table with USE.

* Same as CatchBrowse.prg

private q
q = findinstance("query")
? q.rowset.tablename
_app.q = q

if not empty(findinstance("query", q))
    msgbox("There is more than one query active:  ";
       + findinstance("query", q).rowset.tablename ;
       + chr(13) + "But still put in _app.q and USEd.", ;
       "GrabBrowse", 48)
endif

use (q.rowset.tablename)

return (q)

**********************