Visual FoxPro
The Menu System
o Similar to other Window applications, and is easy to understand
Menu Bar
Command
Window
o The Menu Bar - Menus
File Menu used to create, open, close, save and print files.
Import aand Export command let you share data with other
applications
Edit Menu use similar to other windows applications, such as,
cut, copy and paste. It also includes Find and Replace and Goto
which let you move through a file
View Menu includes toolbars
Format Menu lets you format text (e.g Font, spacing)
Tools Menu includes a few tools that everyone can use, let you
use the Wizard, Spell, etc.
Program menu lets you run programs, stops programs that are
running, and compile programs
Window Menu lets you switch among document windows
Help Menu lets you use the Help system
o In Summary
The File, Edit, Windows, and Help menus are used as they are in
other Windows applications
The Tools, Program, and Format menus let you use utilities
The View menu is used for viewing the data in a table that you
have already opened using the File menu and for working with that
data
The Table menu that is added when you open a table is also used
for working with data
Other Menus, such as Report menu and Query menu are also added
when you are designing other types of files.
o The Command Window
The Command window is a Visual FoxPro system window. When
you choose menu commands, Visual FoxPro language commands
are echoed in the Command window. In addition, choices you
make from menus and dialog boxes are echoed in the Command
window
The Command window is an editing window; therefore, you can
edit code using the editing tools available in Visual FoxPro. For
example, you can edit, insert, delete, cut, copy, or paste text in the
Command window.
You can also type Visual FoxPro commands directly into the
Command window. In the Command window, you can:
Delete text by pressing ESC if you haven't already pressed
ENTER to execute the command.
Reissue a previous command by placing the cursor
anywhere on the command line, and then pressing ENTER.
Re-issue a block of code by selecting it, and then pressing
ENTER.
Split lengthy commands by typing a semicolon after a
space in the command where you want it to break, and then
pressing ENTER.
Move text within the Command window and to other
editing windows. Select the desired text and drag it to the
desired spot.
Copy text within the Command window and paste it into
other editing windows without using Edit menu commands.
Select the desired text, hold down CTRL, and then drag the
text to the desired spot.
In general, you can do anything in the Command window that you
can do in a program. For example, you can execute a line of code,
such as a Visual FoxPro command, by typing it in the Command
window. However, when you execute code in the Command
window, that code is executed immediately. You can also run
multiple lines of code in the Command window as if though they
were in a self-contained program.
File Types
o Table with extension .dbf . File that is used to hold data
o Query with extension .qpr (generated query program) or .qpx (compiled
query program). File that is used to control which records and fields of a
table are displayed, and the order in which records are displayed. A query
lets you pull data out of a table in a form that is convenient to use
o Form - with extension .scx . A file that contains a custom data-entry
screen that makes it easy to view and work with data
o Report - with extension .frx . A file that contains the design of a printed
report.
o Label - with extension .lbx . A file that contains specifications for mailing
labels
Other Files that can be created Using Wizards :
o Project - with extension .pjx . A file used to hold other files used in an
application. A project can be used to organize files to make them easier to
work with. It is also used by developers to compile all these files into a
stand-alone application.
o Database - with extension .dcx . A type of file that lets you create a
database schema to define persistent relationships among tables of a
relational databse
o Program - with extension .prg . A plain text file used to hold Visual
FoxPro programming code
o Text File - with extension .txt . A plain text file
Type of Data /Field
Data Type
Character
Description
Alphanumeric text
For example, a customer
address
Size
1 byte per
character to
254
Range
Any characters
Currency
Monetary amounts
8 bytes
-$922337203685477.5807
to
$922337203685477.5807
8 bytes in
memory; 1
to 20 bytes
in table
- .9999999999E+19 to .
9999999999E+20
8 bytes in
memory; 1
to 20 bytes
in table
8 bytes
- .9999999999E+19 to .
9999999999E+20
8 bytes
When using strict date
formats, {^0001-01-01},
For example, the price of an
item
Numeric
Integers or decimal numbers
For example, the quantity of
items ordered
Float
Same as Numeric
Date
Chronological data consisting
of month, day, and year
For example, an order date
DateTime
Chronological data consisting
of month, day, year, hours,
When using strict date
formats, {^0001-01-01},
January 1st, 1 A.D to
{^9999-12-31},
December 31st, 9999 A.D.
minutes, and seconds
For example, date and time of
arrival
Double
A double-precision floatingpoint number
8 bytes
January 1st, 1 A.D to
{^9999-12-31},
December 31st, 9999
A.D., plus 00:00:00 a.m.
to 11:59:59 p.m.
+/-4.94065645841247E324 to +/8.9884656743115E307
For example, scientific data
requiring a high degree of
precision.
Integer
Logical
Numeric value with no
decimals
For example, a line number in
an order.
Boolean value of True or False
4 bytes
-2147483647 to
2147483647
1 byte
True (.T.) or False (.F.)
4 bytes in
table
Limited by available
memory.
4 bytes in
table
Limited by available
memory
For example, whether or not
an order has been filled
Memo
General
Character
(binary)
Memo
(binary)
Varbinary
Alphanumeric text of
indeterminate length or
reference to a block of data
For example, notes about a
phone call in a phone log.
Reference to an OLE object
For example, a Microsoft Excel
worksheet.
Any Character data that you
do not want translated across
code pages
For example, user passwords
stored in a table and used in
different countries or regions.
Same as Memo except that
memo field data does not
change across code pages
For example, a login script
used in different countries or
regions.
Binary values.
Varbinary data is similar to
Varchar data in that values do
not include padding with zero
(0) bytes. The length of the
contained value is stored
1 byte per
character to
254
Any characters
4 bytes in
table
Limited by available
memory.
1 byte per
hexadecimal
value up to
255 total
bytes
Any hexadecimal value
internally.
No code page translation is
performed on Varbinary data.