29
FoxPro FoxPro is very powerful Database Management System. Its integrate development Environment allows programmer's language. It is both an interpreter and true compiler. As interpreted language, it translates each command into computer instructions, as it is executes the translation time, most possibly during loops. A compiler improves performance by translating command to machine instructions just once. It replaces commands such as PRINT or LIST with blocks of machine code. This compiled programs run faster than interpreted codes. FoxPro supports arithmetic functions such as addition, subtraction, multiplication, and division. It also provides many special mathematical and financial functions. The main screen combines a menu bar across the top line with a command prompt environment based on the command window. FoxPro opens the command window at the beginning of each session. Commands entered into it execute immediately. Visual FoxPro Visual FoxPro is a data-centric object-oriented and procedural programming language produced by Microsoft. It is derived from FoxPro (originally known as FoxBASE) which was developed by Fox Software beginning in 1984. Fox Technologies merged with Microsoft in 1992, after which the software acquired further features and the prefix "Visual". The last version of FoxPro (2.6) worked under Mac OS, DOS, Windows, and Unix: Visual FoxPro 3.0, the first "Visual" version, reduced platform support to only Mac and Windows, and later versions were Windows-only. The current version of Visual FoxPro is COM-based and Microsoft has stated that they do not intend to create a Microsoft .NET version. FoxPro originated as a member of the class of languages commonly referred to as "xBase" languages, which have syntax based on the dBase programming language. Other members of the xBase language family include Clipper and Recital. (A history of the early years of xBase can be found in the dBase article.) Visual FoxPro, commonly abbreviated as VFP, is tightly integrated with its own relational database engine, which extends FoxPro's

Foxpro Working

Embed Size (px)

Citation preview

Page 1: Foxpro Working

FoxProFoxPro is very powerful Database Management System. Its integrate development Environment allows programmer's language. It is both an interpreter and true compiler. As interpreted language, it translates each command into computer instructions, as it is executes the translation time, most possibly during loops.

A compiler improves performance by translating command to machine instructions just once. It replaces commands such as PRINT or LIST with blocks of machine code. This compiled programs run faster than interpreted codes.

FoxPro supports arithmetic functions such as addition, subtraction, multiplication, and division. It also provides many special mathematical and financial functions.The main screen combines a menu bar across the top line with a command prompt environment based on the command window. FoxPro opens the command window at the beginning of each session. Commands entered into it execute immediately.

Visual FoxProVisual FoxPro is a data-centric object-oriented and procedural programming language produced by Microsoft. It is derived from FoxPro (originally known as FoxBASE) which was developed by Fox Software beginning in 1984. Fox Technologies merged with Microsoft in 1992, after which the software acquired further features and the prefix "Visual". The last version of FoxPro (2.6) worked under Mac OS, DOS, Windows, and Unix: Visual FoxPro 3.0, the first "Visual" version, reduced platform support to only Mac and Windows, and later versions were Windows-only. The current version of Visual FoxPro is COM-based and Microsoft has stated that they do not intend to create a Microsoft .NET version.

FoxPro originated as a member of the class of languages commonly referred to as "xBase" languages, which have syntax based on the dBase programming language. Other members of the xBase language family include Clipper and Recital. (A history of the early years of xBase can be found in the dBase article.)

Visual FoxPro, commonly abbreviated as VFP, is tightly integrated with its own relational database engine, which extends FoxPro's xBase capabilities to support SQL query and data manipulation. Unlike most database management systems, Visual FoxPro is a full-featured, dynamic programming language that does not require the use of an additional general-purpose programming environment. It can be used to write not just traditional "fat client" applications, but also middleware and web applications.

Page 2: Foxpro Working

OBJECTIVESVisual Foxpro menus use shortcut keys use Visual FoxPro menus , Database Management System (DBMS) is a generalized software package used to build and manage the database, i.e., add, modify

(edit), update, delete and sort (arrange in a particular order) information in the database. DBMS also helps to retrieve the desired information in the required format from the database. Visual FoxPro is a leading database Management System. It is a member of

Microsoft Visual Studio. Visual FoxPro is one of the Relational Database Management System (RDBMS). It is windows based Graphical User Interface (GUI) RDBMS. The database is a broader concept in Visual FoxPro in which the information is stored in related tables. The table is equivalent to database of the earlier version of FoxPro. A database is a collection of various records comprising rows and columns. One row is one record and one column is one field. A record is collection of logically related fields and a field is one column information. In Visual FoxPro, there can be more than one table storing different stream of information. A table in a database contains a number of Rows and Columns. One row in the table is equivalent to one record and one column is equivalent to one field.

HistoryOne of the first RDBMS for the PC was developed by ASHTON-TATE in 1979-80 that was called dBASE II. Then that company introduced its updated version named dBASE III. Soon, many industries began to use dBASE III to handle their business-related data. Later, ASHTON-TATE released its enhanced and updated version and named it dBASE III PLUS.

Fox software, Inc. introduced FoxBASE + that was almost compatible with dBASe III PLUS. Then it was updated and named FoxPro. Gradually, new versions of FoxPro were released to make it more powerful and user friendly

STARTING VISUAL FOXPROThe minimum hardware/software configuration of the machine required for installing Visual FoxPro is that you should have a Pentium Series of Computer with 32 MB RAM and 10GB of Hard Disk Drive with Windows 95 or higher operating system. Here we have discussed 6.0 version of Visual Foxpro In order to start with Visual FoxPro, you must ensure that Visual FoxPro system is already installed on your computer. To invoke Visual FoxPro, Double click the My Computer Icon on the Desktop Window. Then double click C: drive. Now, click on Program Folder and then Microsoft Visual Studio. Now double click the Microsoft Visual FoxPro icon : Visual FoxPro icon within Program Folder of Windows You can also make a shortcut of Visual FoxPro icon on your desktop for directly loading the

Page 3: Foxpro Working

USING THE VISUAL FOXPRO MENUSThe Visual FoxPro Menu system can be classified into the following

components as:

1. Menu Bar2. Menu Pad (Item)3. Menus (Pull Down Menu)4. Menu Options5. Toolbar

Menu Bar

A Menu Bar is located at the top of the screen and displays all the available titles for menu. The content of the menu bar changes when you move from one title to another title of the menu bar.

Menu Pads (Items)

The titles displayed on the menu bar are called Menu Pads (Items). You can use either the mouse or the keyboard to display the menu associated with each menu pad. Using the mouse, click on the title of the menu you wish to use. To access the menu bar from keyboard, press <ALT> or <F10> key and then type the underlined letter for the menu you wish to use. For example <ALT>+F for invoking File Menu. You can also use the Left and Right arrow keys to move from one menu pad to another menu pad, and press <RETURN> key. You will also find that some of the menu pads appear dimmed and cannot be highlightted or selected. These menu pads are disabled. You cannot display the menu if the menu pad is disabled.

Menus

When you choose a menu pad from the menu bar by clicking the menu pad, Visual FoxPro displays a pull-down menu. A Menu is a list of related options displayed in the pull-down menu. When you choose an option from a menu, Visual FoxPro executes it. Choosing an option means activating a highlighted option by clicking with mouse or pressing the <Spacebar> key or <Return> key.

Menu Options

When you choose a menu pad from the menu bar, Visual FoxPro displays a pull-down menu. A pull-down menu contains options. The options on each menu are logically related to menu pad. To choose a desired menu option you want, use one of the following

methods:

1. Move to the menu pad and click. The pull-down menu appears.2. Click on the desired option you want.3. Press <Alt> key or <F10> key and then press the underlined letter (hot key) in the menu pad

name. 4. Type the underlined key for the menu option you want.5. Visual FoxPro - An Introduction:: 396. Use the Left and Right Arrow keys to the menu pad you want touse and then press <Return>

key. Use the Up and Down arrow keys to select the desired option and then press the <Return> key or <Spacebar> key.

7. You will find that some of the menu options have an ellipsis (…) after the option

Page 4: Foxpro Working

8. . This indicates that the option will further open a dialog box. A dialog box appears to request the additional information.

Toolbar

The Toolbar appears below the menu bar and displays the icons as . To access the toolbar using the mouse, click on the icon you want to use.

The File Menu Options  The File menu pop-up list contains options related to accessing files (creating new files, opening existing ones, closing, saving, and printing).

File Menu OptionsMenu Option Description

New Opens the New dialog box. The options in this dialog box enable you to create new projects, databases, tables, queries, connections, views, remote views, forms, reports, labels, programs, classes, text files, and menus.

Open Opens the Open dialog box, which opens any file type listed under New.

Close Closes the active window. If you press Shift and open the File menu, this option becomes Close All, which closes all open windows.

Save Saves the file in the active window with its current name. For a new file that has no name, the option prompts the user for a filename.

Save As Prompts the user for a new filename before saving the file. Save As Class Saves the current form or selected controls as a class

definition (active only from within the Form Designer). Revert Cancels changes made in the current file during the current

editing session. Import Imports a Visual FoxPro file or a file formatted by another

application. You can also use this option to start the Import Wizard.

Export Exports a Visual FoxPro file in another application's file format.

Page Setup Changes the page layout and printer settings for reports. Page Preview Displays pages in a window as they will appear when

printed. Print Prints the contents of the current window, a file, or Visual

FoxPro's Clipboard. Send Enables you to send email. <project files if any> Provides quick access to reopen any of the last four opened

projects. Exit Exits Visual FoxPro. Choosing this option is the same as

typing QUIT in the Command window.

Page 5: Foxpro Working

The Edit Menu Options  The options in the Edit menu provide functions that are used for editing programs, forms, and reports. This menu also contains options that create object linking and embedding (OLE) objects. Table 1.4 lists the options that appear at various times in the Edit menu pad.

Menu Option DescriptionUndo Reverses an unlimited number of changes made in the

current edit session. Changes made before the last save, even if made during the same session, are not reversible.

Redo Performs a reversed change again. Cut Removes the selected text or object from current document

and places it on the Clipboard. Copy Makes a copy of the selected text or object and places it on

the Clipboard. Paste Copies the current contents of the Clipboard to the current

insertion point. Paste Special Used to insert OLE objects from other applications into a

general field. You can embed objects or merely link them. Visual FoxPro stores a copy of embedded objects in the current object. When an object is linked, FoxPro stores a path and name reference to the original object only.

Clear Removes selected text without copying it to the Clipboard. Select All Selects all objects in the current window. This option is

used often in form and report design to move or format all objects at the same time.

Find Displays the Find dialog box, which is used to locate text strings in files. Find options include the capability to ignore case, wrap around lines, match entire words, and search forward or backward.

Find Again Repeats the last Find starting at the current insertion point position rather than the beginning of the document.

Replace Displays the Replace dialog box, which is used to locate and replace text strings in files.

Go to Line Used primarily during debugging to go to a specific line number in a program file. This option cannot be used when word wrap is on. (Of course, you don't have word wrap on when you edit your FoxPro programs-right?)

Insert Object Similar to Paste Special, except that it does not assume that the object already exists and is stored on the Clipboard. The option embeds objects in general type fields. When chosen, Insert Object opens the other application without exiting Visual FoxPro. After creating the object in the other application, Insert Object returns to Visual FoxPro and inserts the linked or embedded object.

Page 6: Foxpro Working

Object Provides options for editing a selected OLE object. Links Opens linked files (OLE) and enables you to edit the link. Properties Displays the Edit Properties dialog box, which enables you

to affect the behavior, appearance, and save options of the edit windows.

The View Menu Options  The View menu displays options that are appropriate for viewing the current table, if one is open. If you are not currently viewing a file, the menu displays a single option (Toolbar) that opens the Toolbar dialog box, which lists the available toolbars used by Visual FoxPro 6. On the other hand, if you already are browsing a table or editing a form, menu, or report, additional options appear

View Menu OptionsMenu Option Description

Edit Changes to an Edit layout style for viewing and changing records. The option displays fields vertically, and a horizontal line separates records (if grid lines are active).

Browse Changes to a Browse layout style for viewing and changing records. The option displays fields horizontally; rows represent records and columns represent fields.

Append Mode Appends a blank record to the end of the table and moves the record pointer to the first field in it.

Design Displays the Form, Label, or Report Designer. Tab Order Enables you to set the tab order in forms. Preview Shows a preview of labels or reports onscreen. Data Environment Defines tables and relations used in a form, form set, or

report. Properties Displays the Properties dialog box for forms and controls. Code Opens the code windows when you are editing object

methods. Form Controls Toolbar

Opens the Form Controls toolbar while you are in the Form Designer.

Report Controls Toolbar

Displays the Report Controls toolbar, which enables you to add controls to a report.

Layout Toolbar Opens the Layout toolbar, which helps you align controls. Color Palette Toolbar Opens the Color Palette toolbar, which enables you to

select foreground and background colors for a control. Report Preview Toolbar

Provides buttons that move between pages of the preview, change the zoom factor, print the report, and exit preview mode.

Database Designer Opens the Database Designer, which maintains tables,

Page 7: Foxpro Working

views, and relationships stored in a database. Table Designer Opens the Table Designer, which enables you to make

structure modifications to associated and free tables and to their indexes.

Grid Lines Toggles the display of grid lines on and off. Show Position Displays the position, height, and width of the selected

object or form in the status bar. General Options Adds code in a menu when you are using the Menu

Designer. Menu Options Adds code to specific menu options. Toolbars Displays a dialog box that lists every toolbar used by

FoxPro, enabling you to customize the buttons in toolbars and to create your own.

The Format Menu Options  The Format menu normally consists of options that control font characteristics, text indentation, and spacing. Additional options become available, however, when you are using the various Designers, and are described

Format Menu OptionsMenu Option Description

Font Selects a font and its characteristics. Enlarge Font Enlarges the font used in the current window. Reduce Font Reduces the font size used in the current window. Single Space Single-spaces the text in the current window. 1 1/2 Space Uses 1 1/2-line spacing for the text in the current window. Double Space Double-spaces the text in the current window. Indent Indents the current or selected lines in the current window. Unindent Removes the indent of the current or selected lines in the

current window. Comment Comments out the selected lines. Uncomment Removes comments from the selected lines. Align Opens options that align selected objects. Size Opens options that size selected objects. Horizontal Spacing Provides options that adjust horizontal spacing between

selected objects. Vertical Spacing Provides options that adjust vertical spacing between

selected objects. Bring to Front Moves the selected object to the top of the objects in a

form. Send to Back Moves the selected object to the back of the objects in a

form.

Page 8: Foxpro Working

Group Associates a selection of objects in reports and enables you to work with them as a group.

Ungroup Breaks a group definition into individual objects again. Snap to Grid When you are moving objects, repositions the top-left

corner to the nearest grid intersection when the mouse button is released.

Set Grid Scale Determines how far apart the vertical and horizontal grids are.

Text Alignment Aligns text in the selected object. Fill Defines a fill pattern for shapes. Pen Defines a pen thickness and style for shapes. Mode Defines whether the background of an object is opaque or

transparent.

The Tools Menu Options  The Tools menu provides a variety of programmer tools, ranging from wizards to the debugger.

Tools Menu OptionsMenu Option Description

Wizards Lists and provides access to Visual FoxPro's wizards. Spelling Primarily spell-checks text fields and memos. Macros Defines and maintains keyboard macros. Class Browser Examines the contents of any class to view its properties

and methods or even the actual code used to create the object.

Beautify Reformats program files to add indenting and capitalization.

Debugger Opens the Debugger window. This improved replacement for the Debug and Trace window adds windows for watch variables, locals, call stack, and the capability to track events and analyze coverage during testing.

Options Provides access to Visual FoxPro configuration options.

. The Program Menu Options  The Program menu consists of six options that are related to compiling and running a program..

Program Menu OptionsMenu Option

Description

Do Runs a program selected from a dialog box. Cancel Cancels the current program. Resume Resumes the current program from a suspended state. Suspend Stops the current program from executing but does not

Page 9: Foxpro Working

remove it from memory. Compile Translates a source file into object code. Run Runs the current program. (The option appears in the menu

as Do, followed by the name of the PRG.)

.

The Window Menu Options  The Window menu contains options that manage open windows onscreen. The menu provides options that enable you to Arrange All, Hide, Clear, and Cycle through windows. In addition, the menu enables you to bring to the front any window that is currently open..

Window Menu OptionsMenu Option Description

Arrange All Arranges open windows as non-overlapping tiles. Hide Hides the active window but does not remove it from

memory. Show All Displays all defined windows. Clear Clears text from the application workspace or current

output window. Cycle Moves from one open window to the next, making the next

window the active one. Menu Option DescriptionCommand Window Makes the Command window active and brings it to the

top, opening it if necessary. Data Session Makes the Data Session window active and brings it to the

top, opening it if necessary. This window serves as a valuable tool for monitoring which tables are open in each of the 32,767 work areas.

<Window List> Displays the first nine defined windows. If more than nine windows have been defined, a final option-More Windows-appears. To change focus to any window, simply click its name.

The Help Menu Options  Help is the final menu pad of the System menu. The first two options present different ways to access the help file to get information on commands, functions, or features. The third option lists support options that are available from Microsoft. The last option opens the typical copyright screen for the product; it adds additional functionality by providing system information and allowing the user to run other applications from within FoxPro.

Format Menu OptionsMenu Option Description

Page 10: Foxpro Working

Contents Displays help information via an outline format. Documentation Opens the FoxPro online documentation. Sample Applications Describes the sample applications provided with Visual

FoxPro. Microsoft on the Web Opens a second menu with options to use your Web

browser to go to a variety of Visual FoxPro pages on the Web, the Microsoft home page, and several other locations.

Technical Support Provides a list of available resources from Microsoft that offer additional help. The list includes a section that answers common questions.

About Microsoft Visual

Displays the copyright screen for the product, along with FoxPro whom it is licensed to, version date, resource filename, default directory, and product ID. Additional features include the capability to list system information and to run other programs.

VISUAL FOXPRO TEXT EDITOR

Page 11: Foxpro Working

Modify Command is the standard Text Editor of the Visual FoxPro. In short it is also called modi comm. It allows you to create and modify text. Using this text editor you can code or modify a Visual

FoxPro program. The following keys can be used for selecting and editing text. Key(s) Action

Cursor Movement

Right Arrow To move the cursor one character to the right.

Left Arrow To move the cursor one character to the left.

Up Arrow To move the cursor up one line.

Down Arrow To move the cursor down one line.

Home To move the cursor to the beginning of the current line.

End To move the cursor to the end of the current line.

Page up To move the cursor up the height of the current line.

Page down To move the cursor down the height of the current line.

Ctrl+Home To move the cursor to the beginning of the current text.

Ctrl+End To move the cursor to the end of the current text.

Ctrl+Right Arrow To move the cursor one word to the right.

Ctrl+Left Arrow To move the cursor one word to the left.

Selecting Text

Shift+Right Arrow To select one character to the right of the cursor.

Shift+Left Arrow To select one character to the left of the cursor.

Shift+Up Arrow To select one line up to the cursor.

Shift+Down Arrow To select one line down to the cursor.

Ctrl+A To select all text.

Deleting Text

Backspace To delete the selected text or the character to the left of the cursor if no text is

selected.

Del To delete the selected text or the character to the right of the cursor if no text

is selected.

Inserting Text

Page 12: Foxpro Working

Ins To switch between insert and overwrite mode.

SHORTCUT KEYS FOR MENU OPTIONSVisual FoxPro provides various shortcut Keys to choose the menu options. Some of them are listed below :

Key(s) Action

Ctrl+A To select all the current objects.

Ctrl+C To copy the current selection to the clipboard.

Ctrl+D To start a Visual FoxPro Program

Ctrl+G To move the cursor to the designated line in a text or in the command window.

Ctrl+M To resume a program.

Ctrl+P To Print.

Ctrl+R To redo.

Ctrl+S To save the file.

Ctrl+V To paste the content of the clipboard at the current cursor position.

Ctrl+W To leave the current operation and to save

any modification.

Ctrl+X To cut the selected object from its current location and to place it on the clipboard.

Ctrl+Y To append new record.

Ctrl+Z To undo.

Ctrl+F1 To activate the next window open within Visual FoxPro.

Ctrl+F2 To display the command window.

Ctrl+F4 To close the current window.

Ctrl+F5 To restore the current window to its original size.

Ctrl+F7 To move the current window with the arrow key.

Ctrl+F8 To increase/decrease the size of the current window.

Ctrl+F9 To minimize the current window to an icon.

Ctrl+F10 To maximize the current window.

Page 13: Foxpro Working

Esc To exit current editing without saving the modification.

F1 To activate on-line help.

F2 To open the view window.

F3 To list the content of the current table.

F4 To list the files in the current directory.

F5 To display the structure of the current table.

F6 To display the status.

F7 To display the current memory variables.

F8 To display the field names and the current record of the current table.

F9 To open the Browse window in append mode.

You can exit Visual FoxPro by using any one of the following methods:

Type quit in the command window and press <Return> key. Open the File menu and choose the Exit option. Click mouse on the Control Menu Box from the Title bar of the main Visual FoxPro

window. Press <Alt+F4> key.

Visual FoxPro Data Types

Data type Description Size Range

Blob

Binary data of indeterminate

length.

Blob values are in a memo

(.fpt) file.

No code page translation is

performed on Blob data.

4 bytes in a

table

Limited by available memory

and/or 2GB file size limit.

Character

Alphanumeric text

For example, a customer

address

1 byte per

character to 254 Any characters

Page 14: Foxpro Working

Currency

Monetary amounts

For example, the price of an

item

8 bytes - $922337203685477.5807 to

$922337203685477.5807

Date

Chronological data

consisting of month, day, and

year

For example, an order date

8 bytes When using strict date formats,

{^0001-01-01}, January 1st, 1

A.D to {^9999-12-31}, December

31st, 9999 A.D.

DateTime

Chronological data

consisting of month, day,

year, hours, minutes, and

seconds

For example, date and time

of arrival

8 bytes When using strict date formats,

{^0001-01-01}, 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.

Logical

Boolean value of True or

False

For example, whether or not

an order has been filled

1 byte True (.T.) or False (.F.)

Numeric

Integers or decimal numbers

For example, the quantity of

items ordered

8 bytes in

memory; 1 to

20 bytes in

table

- .9999999999E+19

to .9999999999E+20

Varbinary

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

internally.

No code page translation is

performed on Varbinary

1 byte per

hexadecimal

value up to 255

total bytes

Any hexadecimal value

Page 15: Foxpro Working

data.

Variant

Variant data can be any of

the Visual FoxPro data types

and the null value.

Once a value is stored to a

variant, the variant assumes

the data type of the data it

contains.

Variants are designated with

an e prefix in language

syntax.

See other data

types.

See other data types.

Visual FoxPro Field Types

Field type Description Size Range

Character

(Binary)

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.

1 byte per

character to

254

Any characters

Double

A double-precision floating-point

number

For example, scientific data

requiring a high degree of

precision.

8 bytes +/-4.94065645841247E-324

to +/-8.9884656743115E307

Float Same as Numeric8 bytes in

memory; 1 to

20 bytes in

table

- .9999999999E+19

to .9999999999E+20

Page 16: Foxpro Working

GeneralReference to an OLE object

For example, a Microsoft Excel

worksheet.

4 bytes in table

Limited by available

memory.

Integer

Numeric value with no decimals

For example, a line number in an

order.

4 bytes

-2147483647 to 2147483647

Integer

(Autoinc)

Same as Integer but also an

automatically incrementing value.

Read-only.

4 bytes

Value controlled by

autoincrement Next and Step

values.

Memo

Alphanumeric text of

indeterminate length or reference

to a block of data 4 bytes in table Limited by available

memory.

Memo

(Binary)

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.

4 bytes in table Limited by available

memory.

Varchar

Alphanumeric text.

Varchar is similar to Character except values in Varchar fields do

not include padding with additional

spaces. The length of the contained

value is stored internally.

1 byte per

character up to

254 total bytes

Any characters

Varchar

(Binary)

Varchar type data that you do not

want translated across code pages.

1 byte per

character up to

254 total bytes

Any characters

Page 17: Foxpro Working

Creating A Database FileDatabase is a collection of data files integrated into a single comprehensive file system. This implies the designing and daining structure to store some specific information.

Table Creation- table can be created through command window or from table designer or through wizard.

Using Table Designer- the steps are Use mouse or press alt+f or click the NEW button from file menu or press

ctrl+N key or writing create in command window From new dialog box choose table radio button Type file name such as employee the enter table list box and click on save

button. A blank table designer will appear after inserting a set up off will appear .

Using auto wizard : the predesign format predefined in foxpro.

Page 18: Foxpro Working

COMMANDS

Commands Details

LIST To display or print all or selected information

SET HEADING OFF Not to display a list

CLEAR Clear screens

SET STATUS ON Displays status bar at the bottom of the screen

SET DEFAULT Defines default working drive

SET BELL ON/OFF Controls sounding of bell

SET CONFIRM ON Cursor advances to the next fields/ records only on pressing enter key

CREATE Creates a specified file

QUIT Quits foxpro session

DISPLAY Display selected/all records and also perform calculations.

LOCATE Searches the information and show result in status line and its in within a field

CONTINUE Searches for a specific information in any fields.

EDIT AND CHANGE Edit several edit keysto move the cursor to the desired position in any field and carry out changes

BROWSE Display several records and edit them and also add a new record

REPLACE To change the contents and or add one or more records

GO/GO TO Moves the record pointer to a specified record.

DELETE/DELETE RECORD Marks current/specified record for deletion

RECALL Recalls record marked for deletion

PACK Permanently removes deleted records from database.

MODIFY STRUCTURE Modify the structure of any database file in use.

Page 19: Foxpro Working

MEMO Used to enter long textual information.

DIR/ DIRECTORY/DISPAY FILES LIST FILES

Display directory of database and other files

COPY FILE Makes a duplicate file

ERASE/ DELETE FILE Erases the specified files

RENAME Changes the name of a specified file

RUN Runs the specified DOS command without exiting foxpro

SORTING Slow process makes changes and create a duplicate file

INDEXING Creates changes in the same file open a index file automatically

STORE Creates a specified variable and stores a specified value in it

? Display information in next row

?? Display information in same row

DO To run the programme

MODIFY COMMAND To create a program file with etxn. .PRG

ACCEPT Display a specified message on the screen and accept data entered through keyboard

INPUT Can create a no., character, logical and data variable

WAIT Pause the execution of program

PROGRAM

It is a file contains a series of commands. The series of commands does a specific job.

Creating a program file : There are two ways to create a program file.

Invoke foxpro menu and select File then New

From the list of files types select program and then select the ok button

If we write modify command in the command window a dialog box.

Page 20: Foxpro Working

Using Do while-End do : this is used to execute a set of command repeated by. This is a looping

Example: print the square of no.1 to 10

Store 1 to num

Dowhile num=1

? (num)*(num)

num=num+1

End do

Decision using IF-END IF: to check the condition using this command

IIF( ) the compact IF function : this function returns an expression of condition is evaluated.

SCAN-END SCAN : to specify a condition and execute the commands included within this condtion.

the result is all records of current database that meet the condition.

FOR –END FOR : executes asset of commands within a loop a specified no. of times.

TEXT-END TEXT : can enter any no. of text lines within this condition .we need not to use question

marks. Also if the printer is selected the text line will also printed

REPORTS It is a collection of facts and figures with page no. and headings. There are following tools for preparing reports.

AUTO REPORT :- useful when the requirement is of column or listing of data and simple to create.

REPORT DESIGNER:- create by slecting from the file then new then on reports or by writing create report in the command window.

REPORT WIZARD:- the predesign reports are presented in it on the basis of work