Visual Fox Pro Command Window

A place for discussion on how to use the program more effectively

Post Reply
MrZed
Posts: 37
Joined: Sat Jun 05, 2004 8:39 pm

Visual Fox Pro Command Window

Post by MrZed »

Hi, John.

Donor Manager comes with the fox6command.exe so that I can use the command window to massage the database. Can you point me to some documentation for common commands that I would need to make this work? I don't own a foxpro manual that might contain this information and there does not appear to be a help screen -- so I'm pretty much probing blind.

Dan
(can't find those e-mails that you sent months ago that described a few of the commands).
jmuehleisen
Site Admin
Posts: 737
Joined: Sat May 29, 2004 1:28 pm
Type the middle number, please (202): 202
Location: Kampala, Uganda
Contact:

common FoxPro commands

Post by jmuehleisen »

Dan,

Jake gave you a great link to all of the online documentation for FoxPro. That is the ultimate resource.

It goes without saying that you should make a backup of your data before messing around at the command level, because you can do some real damage to your data very quickly, and there is no turning back!

But, of course, all donor manager users very faithfully make backups of their data, don't they?

Here are a few FoxPro commands to get get you started quickly:

The first thing I'd type in the window is this command so the program can find the data easily in the data folder:

Code: Select all

set path to data
This only needs to be done once in a session.

Then, to open a data table, you use the "use" command. For example, to open the main donor table, enter this command:

Code: Select all

use donor
To browse the file (once it is open) like an excel spreadsheet, simply enter "browse"

Code: Select all

browse
To view one record at a time, enter "edit"

Code: Select all

edit
To add a new, blank record, enter "append"

Code: Select all

append
Press "Control W" (for Write) to save and get out of any of these editing windows.

To close a table, simply enter "use" with no filename

Code: Select all

use
To get out of the command window, simply enter "quit"

Code: Select all

quit
Let's say that you'd like to browse a list of all of your partners in Ohio. Try this series of commands

Code: Select all

set path to data             <note: only if you have not already set the path>
use donor
browse for state = 'OH'           <single or double quotes are OK>
quit
Or, perhaps you would like to put in "USA" as the country code for all partners where the country code is currently empty. This code assumes that you have already set the path and opened (or "use"d the donor table):

Code: Select all

replace all country with 'USA' for empty(country)
But, the key thing to remember, is that these changes happen "right now" and there is no going back! But you can do some very powerful things at the command prompt. FoxPro is a very easy to use, but very powerful data language. Use with care.
John Muehleisen
Mentoring Emerging Christian Leadership in Africa for Excellence / Integrity / Innovation
Post Reply