Tuesday, April 22, 2014

foxpro commands



FoxPro Command /  Programming
What is Data?      
Data can be anything like a name of person rollno of student or name of a city.
 What is Information?
When Data is in meaning full way or related with each other its called Information.
What is Database?
Database is an organized collection of related information.
What is DBMS?
DBMS stands for Database Management System. The system which collect data from user and manage that data properly, is called Database Management system.
What is RDBMS?
 RDBMS stands for Relational Database Management System. RDBMS is advance feature of DBMS. RDBMS provide the facility to  create a relation between two tables.
 What is FILE ?:-
In FoxPro File is a collection of records and fields. Row represent record and column represent field
 What is RECORD ?:-
 Data is stored in one horizontal line of database is called record. In other words Record is a collection values in fields of table.
What is FoxPro?
FoxPro is one of the leading DBMS(Database Management System) software for pc. This is enhanced version of the FoxBASE+ Software FoxPro is also called RDBMS software and foxpro is use to create database table of database management system.
Data types available in FoxPro
  1. Numeric:-
Numeric datatype is use to store numeric data into a field. We can store 0 to 9 digit, decimal point and plus or minus sign. A numeric field can hold upto 20 digit wide. A numeric fields can also have a decimal part. The decimal part can be upto 0 to 18 digit. To store a field like Roll_no, mobile_no, phone_no, salary, pincode etc numeric field type is used.
2. Float :-
Float datatype is similar to numeric. Difference between two is that for arithmetic calculation numeric datatype is used while float is used for scientific calculation. It can also hold upto 20 digit wide. We can store 0 to 9 digit, decimal point and plus or minus sign. To store the fields like Rate, percentage, average float is commonly used.
3. Character :-
Character datatype is use to store string type information. It can store A to Z , a to z alphabets 0 to 9 digit and underscore with special symbols etc. To store the fields like name, address, result etc character is used. Character is default datatype for all the fields. In Character data type we can store upto 254 character. Default size of character is 10 fix.
4. Date :-
Date datatype is use to store date in any field. The default format of date is (mm/dd/yy). The fix length of date is 8.To store the fields like Dob, doj, ex_date etc date field is used.
5. Logical :-
The length of logical field is 1. we can store 'T' or 'F' or 'Y' or 'N' in logical field. 'T' or 'Y' for true and 'F' and 'N' for False. To store the information like pass/fail, absent/present etc. logical field type is used.
6. Memo :-
Memo field is special field of FoxPro in which you can store any amount of data. Memo field is use to store long textual information. The name of memo file has '.fpt' extension. FoxPro allocates a ten bytes space in main dbf to store the location of memo data is in auxiliary memory.
 7. General :-
General field is use only for FoxPro for window version. In general field we can store textual data, picture, sound etc.
Simple commands of FoxPro:-
Create command:-
Create command is use to create a new database file in FoxPro. We have to specify the name of file after the create keyword.
Syntax                 : creat <tablename>
Example              : creat student
Clear command:-
Clear command is use to clear the screen.
Example              : clear
Dir command:-
Dir command is use to see all the database file list of your current folder.
Example              : Dir
Append command:-
Append command is use to append a new record in your table.
Syntax                 : append [blank]
Example              : append
Display structure command:-
Display structure command is use to display a structure of your currently open table.
Example              : disp stru
Modify structure command:-
Modify structure command is use to modify the structure of your currently open table.
Example              : modi stru
Use command :-
Use command is use to open a your table in current work area. Use command is also use to close currently open table is well.
Syntax                 : use <tablename>[in <expn>/<workareaname>]
Example              : creat student
Display command:-
Displays the contents of records in the current table/.DBF and the results of expressions.
List command :-
List command displays all the records of currently open table and the result of expression.
Syntax:- List [[FIELDS] <field list>]
Edit /Change command:-
Edit or Change command is use to edit the record which are inserted before by us.
Syntax:-
Edit [[FIELDS] <field list>]
Browse command:-
Browse command opens a browse window to change records of currently open data base file like a tabular format.
Syntax:- Browse [FIELDS] <field list>]
Delete command :-
Delete command is use to make a mark of Delete of record in currently open data base file. Records marked for deletion are not physically removed from the table until PACK is issued. Records marked for deletion can be recalled (unmarked) with RECALL command
Recall command:-
Recall command is use to unmark the record which are marked for deletion by Delete command. Before using recall command there must be zap or pack commands are not used.
Syntax:-            Recall [<scope>]
Pack command:-
PACK command is use to permanently removes all records marked for deletion in the current
table/.DBF.
Synaex:-            pack
Zap command:-
ZAP command is use to permanently removes all records from current table/.DBF. by leaving just structure of a table.
Example:-          zap
Go/Goto command:-
Go/Goto command is use to Positions the record pointer on the specified record number in a table/.DBF.
Syntax:-             Go <expN>[in <expN> or <expC>]
GO TOP | BOTTOM
Example:-          Go top
Replace command :-
Replace command is use to insert a value in field. Replace is also use to change the value of fields in table/.DBF.
Ex:- replace all total with hindi+English+math+sst+science
Locate command :-
Locate command is use to search the record sequentially in table/.DBF. for the first record that matches a given logical exp.
Syntex:-             locate for name=”abdul”
                             Display
Erase command :-
Erase command is use to delete any database file. You have to specify the name of file that you want to delete.
Syntax:-             Erase <tablename>
Example:-          Erase student
Copy command :-             Copy command is use to copy one folder to another folder.
Syntax:-            copy <source path+tablename> to <destination path>
Example:-          copy e:\pgdca\student.dbf to e:\bca\student.dbf
 Rename command :-                   Rename command is use to change the name of your file.
Syntax:-             rename <old tablename> to <new tablename>
Example:-          rename abdul to manoj
Close all command :-
Close all command is use to close all open programs, databasefile, indexfile etc.
Syntax:-             Close all Example:-   Close all


37 comments:

  1. *m.TmpAccnt_No = LTRIM(STR(VAL(m.Accnt_No)))
    m.TmpAccnt_No = ALLT(m.Accnt_No)
    If Used("Signpara")
    Sele Signpara
    If Seek(m.Accnt_Code)
    mCodeId= Code_Id
    Else
    mCodeId= ''
    Endif
    Else
    mCodeId= ''
    Endif
    m.SignFile = "SIGN\" + RIGHT(m.TmpAccnt_No,1) + '\' + allt(mCodeId) + m.TmpAccnt_No + ".jpg"

    IF !EMPTY(m.Accnt_No)
    IF !FILE(m.SignFile)
    WAIT WINDOW "Signature file not found"
    RETURN
    ELSE
    * @ 9.360,7.500 CLEAR TO 44.100,350.850
    * @ 9.360,7.500 TO 44.100,350.850
    * @ row,col SAY signfile Joint Photographic Experts Group ;
    SIZE len, wid ;
    ISOMETRIC ;
    STYLE "T"

    @ 12,14 CLEAR TO 620,600
    @ 12,14 SAY signfile JPEG ;
    SIZE len, wid ;
    ISOMETRIC ;
    STYLE "T"
    ENDIF
    ENDIF

    ReplyDelete
  2. Ek aisa progarm banaye jo lagatar 10 alag alag sankhya ko input kare tatha unme kul sum ya visum sankhya ko print kare

    ReplyDelete
    Replies
    1. प्रोग्राम कौन से लेंग्वेज में चाहिए... C language, c++ या ओर कोई

      Delete
  3. Thank you for providing such a wonderful knowledge

    ReplyDelete
  4. Guys agar aap or information चाहते हो तो इस वेबसाइट पर जाएं www technicaltips.gq

    ReplyDelete
  5. SELE A
    USE PINFILE
    INDEX ON CCNEEPIN TO A
    SELE B
    USE SHIPTEMP
    INDEX ON CCNEEPIN TO B
    SET RELA TO CCNEEPIN INTO A
    REPL ALL CCNEEADR1 WITH A.ADR1 FOR CCNEEPIN=A.CCNEEPIN

    AAGAR MUJHE MERE DATA FILE ME ADDRESS1 MAOJUD HO TO MUJE ADDRESS1 REPL NAHI KARANE KE LIYE KONASI COMMAND USE KARANI CHAHIYE

    ReplyDelete
    Replies
    1. Please tell me how to make report with example

      Delete
  6. Close data file ko copy kaise Kare?

    ReplyDelete
  7. for deleat some entry from dbf file

    ReplyDelete
  8. how to lock escape key in foxpro for dos

    ReplyDelete
  9. command to get list (party name,gst#) from master table;

    ReplyDelete
  10. Mere pass 3226 reacad ka dbg hai.jisame bahut sare office ka data hai hai .Hum chahate hai ki kewal mere branch ka data bache baki ka delet ho jaye .To recall ka kaun sa command use hoga ki kewal mere hi office ka data sesh bache.
    Kripya batane ka kast kare.
    Sadar pranam.

    ReplyDelete
  11. kako se edituje tabela.dbf sa komandom edit i neki window

    ReplyDelete
  12. how command edit in vfp with command window

    ReplyDelete
  13. 😇😇 Supar brother😇😇
    😜😜Padkar Mazza aa gaya🤗🤗

    ReplyDelete
  14. Excellent post. You have shared some wonderful tips. I completely agree with you that it is important for any blogger to help their visitors. Once your visitors find value in your content, they will come back for more What is the DBMS and it's uses



    ReplyDelete