Foxpro was created based from the original Dbase technology. In the early days, these types of languages (foxpro, dbase, clipper) were referred to as xbase languages.
Anyway, in the old days we were not able to select a table by its alias name. We had to select it by a work area number.
I.E.
SELECT 1
SELECT 2
As time passed, changes were made to the languages to allow us to use the alias name. This is a great improvement since we no longer need to remember which table is open in which work area. Most programmers realized this and quickly adopted the alias approach. However, some never changed either because they were unaware of the change, or just used to the old way.
To make a long story short. SELECT 34 is select the table that is in work area number 34. As Mike mentioned, you can determine the name of that program with:
? SELECT()
You may wish to change the code so it does not select 34, but selects the alias. I'll assume it is called "master"
Just to add to the good advice you've already been given:
A work area is a place where you open a table. You open each table in its own work area. When you want to do something with one of your open tables, you 'move to' that table's work area, which you do with the SELECT command.
Work areas are numbered in sequence, starting at 1 and going up to 32,767 (you typically only use a dozen or so work areas at any one time).
It is better to ignore those numbers and to use the table alias instead. The alias is, by default, the same as the table name, but you can give it a different alias if you wish at the time that you open the table. You use the ALIAS clause of the USE command to specify the alias.
There is a notional work area number 0, which means 'the next available work area'. So, the usual way to open a table is to use this command:
USE MyTable IN 0
That means that the table will open in the first free work area. You then use its alias (MyTable, in this example) to reference that work area:
SELECT MyTable
&& do something with the table
The above is highly simplified explanation. Think of it as the least you need to know in order to get started.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.