FoxPro/Select Vs Use
Expert: Anthony L. Testi - 8/5/2004
QuestionHi Sir
How are You.
Sir what is the technical difference between select and use command to open a table
Also sir give brief detail's of both command's
using vfp7
AnswerSelect cannot be used to open a table. A table must be opened first ( via the Use command is one way but there are others. ) and SELECT allows you to returned to an already open table.
VFP can have many tables open at one time; each table is contained in a workspace
OK here is an example ( Code not tested ) and assuming VFP 3.0 +
Close Database ALL
USE Table_A &&-- Opens the table_A
USE Table_B &&-- Opens the Table_B but closes Table_A because it was in same workspace.
Select 0 &&-- ‘Magic' command that finds a blank work space
USE Table_C &&-- Opens table C, Table_B is still open in another workspace
Select Table_B &&-- Table_B is now selected, and Table_C is still opened in another workspace
? Alias( ) &&-- Displays on the screen the table name: “Table_B”
Use &&-- W/O a table name it closes the Table_B
? Alias( ) &&-- Blank as this workspace has no table open in it
Select Table_C
? Alias( ) &&-- Displays on the screen the table name: “Table_B”
FoxPro ( pre visual ) could have from 10 to ~200 tables opened depending on the version. Now VFP can have I think ~32,000 tables opened.