Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return Workarea Number? 2

Status
Not open for further replies.

diarmaid

Programmer
Jun 27, 2003
34
IE
Hi all,

Is there a way to discover what workarea number is being used by a particular alias ?

I need to do this as I need to set a pointer in a table with an app I didn't create.

Many thanks for any help,
Diarmaid
 
diarmaid

From the help file.

AUSED() Places table aliases and work areas for a data session into a variable array.

AUSED(ArrayName [, nDataSessionNumber])


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Diarmaid,
No, there is no direct function to do this. You'd have to set up a loop and check through all the workareas until you find the one you need.

I'm still unclear as to why you can't use the alias it self to refer to the table. Using hardcoded workarea numbers went out with dBase II!

Rick
 
Hi Diarmaid,

SELECT() will give you the workarea number of the currently selected table.

Jim
 
Jim,
You're right - sometimes it's easy to forget the simple way to do things!

Of course Mike's technique will work easier if the table isn't in the current datasession.

Rick
 

Thanks all,

both tips were useful, I eventuall found the alias() function and used it within the form I wanted to investigate to find which workarea was in use.

The app involved in an old Foxpro Windows 2.6 one, I couldn't get SEEK to work with the alias name, howeverm it does work with workarea numbers.

Best wishes,
Diarmaid
 
Seek() works with aliases in FPD and FPW, just make sure you quote the alias if it's not in a variable.
Code:
Close All
select 0
use detail order 1
select 0
use master order 1
?seek("a","detail")
*OR
lcAlias = "detail"
?seek("a", lcAlias)
*OR (in this case)
?seek("a", 1)
Rick





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top