Some common operations on dataCREATE, LIST, APPEND, CLOSE, QUIT

Fox Pro Command


Fox Pro Command

FoxPro is a programming language. FoxPro is 4 GL language is used very easy & very to learn. It is simple language because number of English word as code in a FoxPro. FoxPro is used to create database table or database management system. Father of FoxPro is Ashito Tate. FoxPro is developed in 1979- 1980. FoxPro is two versions.
Ex: - 1) Database II, 2) Database III developed in 1984.      3) Database III+. 
FoxPro is also called Relational Database Management System (RDMS). The commands are simple in English. FoxPro called as powerful & flexible with the help of command we create the report, database, memo, screen, program, label. FoxPro requires command.
FoxPro based upon two versions.
1.          Windows based FoxPro.
2.          Dos Based FoxPro.

1)         Create: -
                      Create command is used to create a new database file in FoxPro. To create database file structure defining create file to store specific information and maintain FoxPro defined the structure to store information structure define it also how many fill file. What is length of data how information will be store?
Syntax: - Create < File Name>.
Ex: - Create Student.  

2)         Locate: -
                     Locate is a FoxPro command this is used to find out the record form file.
 Locate searches the information from specified field of database file.
Ex: -Locate for city = “Beed” 
FoxPro searches the city Beed it the Beed has found it will display the contain of search record. Specifies the multiple conditions with command you can locate record with city Beed & pin code number.
Ex: -Locate for city = “Beed”. and.pin =431122
Locate for Name = “Shubham”
It display the record Shubham in the field name “end of locate scope “.
It could searches the record the contain Shubham in the field.

3)         Browse : -
                       Browse is different edit & change it display the record in horizontal table each record occupy one record on the table when your database table does not content many fields. Browse may be more efficient that edit or change the record.
If you want to change the record you more to the position & carry out editing ‘shift + Tab’ move one field to another field.
Ex: - Use Address.
Browse field city, Pin code.
When you want to new record we can use the ‘Ctrl + T’ delete the record form browse menu. With indicated dot for the delete record.
Browse for city “Pune”
These commands record that content pune.
Browse next file
Display the next 5 Record.

4)         Edit or Change: -
                                       Edit is a FoxPro command it provide the change in the data you change the data modify the data were   you have need that some mistake in data you may to need correct it.
FoxPro display first few records on the first field or first record FoxPro use 75% of Window for edit purpose.
Editing the data field in very simple move the circular then change data by using delete key, Backspace key, various, editing key that you can use to move the circular position or delete the character 1) Arrow key, 2) Delete Key, 3) Backspace key,          4) Escape Key, 5) Ctrl + W, 6) Page up & Page down.
Ex: - Edit field Name, City.
If you wish to edit the particular command edit record 5. This command delete record the person who us Beed city.
Edit for city = “Beed”
If you wish to edit name & city field of record that have so edit field Name, City = “Delhi”.


5)         Label Command : -
                                      FoxPro provides a very powerful facility of designing and printing of Mailing address label.
Label Command is used for printing of letters; it is achieved by creating and using labels format file. These format files contain fields as well as these portion in the mailing address level, that there file will generate in the label format.
The label that you will design has to be saved in a label format file. FoxPro is user the extension names. LBX for label format files that it creates.
Syntax: - Create Label < Label File Name >
Ex: - Create Label Student.


6)         Replace: -
                        You have to learn edit, change browse the processing making are changes in very slow process. You need physically select each record before you can make change the process become cumber son if you have make changes in several of the database file know assume that bank of India issues and instruction the reduce the rate of interest all on deposit by one percentage. It is very difficult task manually change the rate of interest in all record of database file using edit, change command.
Ex: - Replace all Rates with Rate- 1.
Replace all Rate with 10 for Rate>10.
Replace depositor with “Krushna”
Replace all name with name = “BCA III”.
Replace city with Beed.
Next 5.






7)         Delete : -
                      Delete the record for your current data base. In case of Student database file way the student for the leave the college then the record is not require the record remove deleted from the database is the command it can delete for the database gives the mark of deletion star ‘*’ mark display before the record will not delete permanently. Record are delete temporary.
Ex: - Delete for rate >10.
Delete for rate >10 next 3.
Delete all for rate =10.
Delete Record 4.

8)         Pack: -
                    Pack command is permanently delete the record form the database file & release the space occupied by display the record after removing delete record it. Display the message indicating know present in the database file pack command given after the delete command delete record not be recall.
Ex: - Pack

9)         Append: -
                        Append command is used to add record at end of database file. After entering data, if we want to add some records then use append command.
Syntax: - Append Command.
However before you can add record to database with append command the database file must be in use open. Create new record & save the record in your current file.

10)    Recall:-
                    Recall command is used to recall the deleted record. The recall command provides another way of recalling record form the command window.
Syntax: - Recall Record Number
Ex: - Use student
Recall Record 4
Recall for Rate>10       
Recall for all for rate+20



11)    List: -
                 List command is used to display content of all record on the screen. It also displays the field names in the first row & recorded numbers on the left each record.
Syntax: - List.
List for < Filed Name1, Filed Name2 >.
Ex: -List.

12)    Accept: -
                      Accept command is used to display a specified message on the screen and it also accepts the data entered through the keyboard in a character variable. The name of the variable that holds the data is specified with Accept.
Ex: - Accept “Enter the student name” to ABC.
After that FoxPro displays a message “Enter the student name” on the screen and waits for the user to enter data. You can type any name then press the other key.

13)    Input Command: -
                                         Input command is a modified command form Accept command. Input command displays the specified message on the screen and stores the entered detain specifies variable.
Ex: - Input “Enter a number” to NVJ

14)    Sort : -
                   Sort command is used to arrange data in Descending & Ascending or record in specific manner or order.
Syntax: - Sort on < Filed Name > to < New File Name >
Ex: - Index on Name to Student.

15)    Index:-
                    Index is command is used to arrange data or record in specific manner or ascending order.
Syntax: - Index on < field Name > to same file name >
Ex: - Use Student
Index on Name to Student.



16)    Modi Stru : -
                             Modi stru stand for modify structure. This command used to create a new database file.
First open the structure database file. Then enter modify structure command in command window. The FoxPro displays present structure of structure file.
Syntax: - Modi Stru
Ex: - Modi Stru.


17)    Modi Comm: -
                                Modi comm stand for modify command. Modi comm is used to create a program file or get the program screen.
Syntax: - Modify Command < File Name >
Ex: - Modi Comm Student.

18)    Zap: -
                 Zap command is used to remove all record form the current or active database file. Zap removes all record permanently form the database. Zap is similar to delete all followed by pack command.
Ex: - Zap.

19)    Clear Command: -
                                      Clear Command is used to clear the background screen,
EX: - Clear.

20)    Go to: -
                   The command is used to position the record pointer at the specified record in the database file.
Syntax: - Go to Record Number.
Ex: - Go to Record – 6.





21)    Find : -
                    Find command is used to search or find information with the help of an index file.
You are use the find command and if FoxPro does not find the information in the database file, if displays a message “No find”.
Ex: - Use Student.
Set Order to City
After that is screen displays record of “Beed” City.
                  
22)    Display: -
                       This is command is used to display information about the current table in the main visual FoxPro Window or in the user defined window.
Syntax: - Go to Record Number.
 Display
                   

23)    Seek: -
                   The seek Command is used to Find Command. It is also used for the search purpose i.e. to search for information in an index database field.
The difference between Seek and Find command is that the Seek command looks for content of a specified variable in the database file, the command Seek with field name looks for the contents of field name whereas find with filed name tries to search the word filed name in the database file.
Ex: - Store “Ramesh” To Name 1
Use Student Order Name
Seek Name.


24)    Skip Command: -
                                    This is command is used to moves the record pointer forward or backward. The record specifies the number of record to move the record pointer.
Syntax: - Skip Record Number.
Ex: - Skip – 6
  


25)    Use Command: -
                                    The Command is used to open an existing database file in FoxPro.
Syntax: - Use < File Name >
Ex: - Use Student.

26)    Delete File: -
                            Delete File Command is used to remove file form the disk.
Syntax: - Delete < File Name >
Ex: - Delete Student. 

27)    Copy File: -
                           The Copy File Command is used to make a copy of database or any other file. We many need to copy a file to diskette for transferring our friend following is the syntax of copy file command.
Syntax: - Copy < Old Name > To < New File Name >                           
Ex: - Copy File Student.DBF. To Student info

28)    Report:-
                     Report generation means the presentation of record in the specific format. Report file controls the display and printing of data. Report are very useful any organization, because they can print summary of the transaction with the help of report generation facility.
We can create are report format. FoxPro report file are created with FRM extension.
Syntax: - Create Report < Report File Name >
Ex: - Use Student.
Create Report Student.

29)    Dir: -
                 Dir Command stands for directory. The Command is used to displays information about the directory in FoxPro window.
Syntax: - Dir Command
Ex: - Dir.


30)    Do Command: -
                                  Do Command is used to your program is complete then command window type do your program is run.
Syntax: - Do < File Name >
Ex: - Do student.

31)    Close All: -
                         Close all open databases and index in the current and any active data work is closed all database file.
Syntax: - Close all command.
Ex: - Close All.

32)    Wait Command: -
                                      The Wait Command is used to stop the execution of program or you wait in the command window it displays a message. 
Press any key to continue...
FoxPro wait for key to be pressed use by user press any key, including Enter key.
Syntax: -
Ex: - Wait “Press enter to any key”.

33)    Store Command: -
                                       Store Command is used to create memory variable and specified value and program.
Syntax: - Store < Field Name > to Memory Variable.
Ex: - Store 10 to Num.
Store “Prashant” To Name.