You are here:

FoxPro/Select Vs Use

Advertisement


Question
Hi 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

Answer
Select 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.  

FoxPro

All Answers


Answers by Expert:


Ask Experts

Volunteer


Anthony L. Testi

Expertise

Microsoft Certified Professional in Visual Foxpro. B.S. Computer Science. 15 years working with xBase, 13 years with Foxpro, 3 years with visual Foxpro. Strong in Database design, business rule programming and user interface design. Special interest in maintainable programming.

Experience

Microsoft Cert. Prof. in VFP both desktop and distributed. B.S. C.S. 18+ years working with xBase 7+ years working with VFP versions

©2014 About.com. All rights reserved.