Microsoft Visual Foxpro




Foxpro icon






           Complete Solution of Foxpro



Data:- Data is unprocessed raw fact and figure(वैसा डाटा  जिससे  कोई सुनिश्चित अर्थ का बोध न हो \  ) for example:- 5
      Here 5 means nothing clear that, what is five(मतलब  की ये फाइव किसी का  है  रॉल है या किसी का ऐज है या गली नंबर है ,या किसी का marks है , कुछ भी clear नहीं हो रहा है )

Information:- Meaningful data is known as Information( वैसे data जिसका कोई मतलब निकले ,उसे इनफार्मेशन कहते है  ) जैसे :- roll no -5 (यहाँ  5 रॉल नंबर को सम्बोधीत करता है l ) , lain no 10(यहां कोई पूछेगा की 10 क्या है , तो हमे  information मिलेगा  की 10 गली no है  | )

Database:-An organised collection of data is called Database. These data may be related to any organization.For example students,Cadets,patients etc.

Database Table:- when ever any organization data are stored in arranging way/tabler form(row or column ) is known as Database Table.Here each row of table is known as record.
                          Here each element of table functionally related to each other. Here the types of record are depend upon name of table(मतलब की अगर कोई table का नाम school है ,तो उसमे stored information किसी स्टूडनेटस या टीचर्स  का ही होगा ,और अगर किसी टेबल का नाम हॉस्पिटल है तो उसमे records किसी patients या doctors का होगा )

Database Management System:- which system manage our data is known as database Management System.Each DBMS has its own DBA(Database Administrator). here the role of DBA is  to manage data related work,such as insertion,deletion,updation of data.

(Q)what is MS. Foxpro?
   Ans:- MicroSoft visual Foxpro is an example of Database, where user stores group of data in a tabler form(row and column).
             Here:-
              Name of table is known as Entity.
               Columns  of table are known as attribute and name of columns are also known as name of Attributes,so total no of attributes is equal to total no of columns.
               Each row of table is known as a  single record, so total no of records is equal to total no  of  rows in a table. 
              In table each Cell is logically related to each other
   (Q)How to open Foxpro?
        Ans:-When user wants to open Foxpro database application in PC then, he needs to install  Microsoft Visual Basic 6.0.This application is a combination of MS Visual C++,MS Visual  Basic, MS Visual Foxpro etc.This application is compatible with Windows Visita,XP, Windows  7,8,10 and also with Windows Server 2012,2016,2019.
         Steps:-
           Start All programsMS Foxpro.
ORM
             OR  Double click on Foxpro application icon.
   (Q) what is Command window?
     Ans:- In microsoft visual forxpro, A command window is a small window in main window of  foxpro. It,'s an active window, where user can type command and also press Enter key to                     perform any specific task related with files(program files and data base file ) in Foxpro. Its contain three button such as maximize,minimize and close button.
         when user open Foxpro database application then command button also open within it. In any case its not visible then click to window menu and also click on command window. 
          
          Command button is a prompt from where a database user try to start any work with the help ofcommand.
            Its a user friendly,because its provide  reuse facility of command,if its used by user in active window.

               
Figure of Command window
      (Q) How to Create a Database File in Foxpro?
        Ans:- To create a DBF(Database File) in foxpro user needs to type Create command in Command window and also press a enter key.
         Syntax:- Create  DBF name
                
                Ex:- Create College 
                               (Here Create is command name and College is DBF name)
            
       After press an enter key a table designer box will be open in the form of:-


        After design fields of table press ctrl+w or OK buttan to close in saving mode then another box will be open in the form input data records now and also select YES button. After that another window will be open where we input records and to save its again press ctrl+w buttons.
       
        Now a database is created.which is visible in Status bar(bottom of screen). Status bar contains
        within Name of Database, Total no of record in that file, EOF(End Of File).
         
                   suppose in status bar show  EOF  2/5 then it means (there are five records in a Dbf ,where  cursor  active on record no two)

        (Q) How to display records of any Created file?
            Ans:- To display the records(total rows of files), user type list command in command window.
            It means list command is command which is used to display data of Created/ Open DBF
            Syntax :- List 
                      (After press enter key total records are displayed on Screen.)
     
                 List command also provide facility to display any particular record on the based on  condition:-
               


 Student.dbf
Name Roll Marks Village
Ram           2               87            patna
Sonu          5               78            Agra
Shyam       8               88            lacknow
Sima          7               60            Delhi

             Here,The name of table is Student by default saved with *.dbf extension.In this table                   Name,Roll,Marks,Village are field name. In this table total no of Records are four.
            * when user type List command then its disply total records of file.
            * If user want to display any particular record on the basis of comdition then:-
                 ***Display records which marks greate than 60 *** 
                   then, type in command window
       List for marks > 60  
Then result shown as output :-

Name Roll      Marks     City
Ram             2          87          patna
Sonu            5          78          Agra
Shyam   8          88          lacknow

***Display record which City name is lacknow*** then, type in command window.
      list for city="lacknow"  
Then result shown as output:-
  Shyam 8 88    lacknow

***Display record which Name  is Ram and City = patna*** then, type in command window 
 list for Name="Ram" .AND.  city= "lacknow"  
       Then result shown as output:-
Ram 2 87      patna

***We can also display records of any particular fields***
            
 list Name,city  
      
Then result shown as output:-
 Student.dbf
Name Village
Ram patna
Sonu Agra
      Shyam        lacknow
Sima Delhi


 (Q) What is Display ALL Command? How its differ from List command?    
Ans:- Like List command ,Display Command is also used for display total records of any open data base file.(Display all  Command का use किसी open DBF के सभी records को देखने के लिए करते हैं ! )

Difference :- The difference shown between List and Display ALL Command,When the Size of file is more than one page. 
                     *   In such case List command display All page at a time,but display all command show records page by page, After press an enter key.
     (List command किसी open DBF के सभी records को एक ही बार में show करता हैं , लेकिन Display All command सभी records को page by page show करता है.! ) 
                    नोट :- Next page को देखने के लिए enter key press करें !

          ***If user wants to display any particular(Single line) record then first of all use GOTO                          command after that press display command***
          Such as:-
                     ***अगर user DBF के तीसरे (3rd No ) Record को देखना चाहता हो ,तब ***
                      ( To Display third no record:-)

 GOTO RECORD 3 
                                                                            DISPLAY 
                    ***We can also display any particular record by using:-
              
                                               display record 3 



  GOTO or GO Command:- This command is used for send cursor on any particular line or record no.
           Syntax :- GOTO record no 
             Ex:-        GOTO record 3 
                  
Note:- There is nothing difference between GOTO and GO command.
          For Ex:- GO record 3  ** To confirm, Type Display command in command 
GOTO record 3 
    DISPLAY  
               नोट :- After press GOTO  Command active record is visible on STATUS bar. Such as:-
  
(i) If total records are 10 then, its display as:-
                3/10 in status bar.
  
(Q) How to close Created/Open any DBF?
    
 Ans:- When user want to close any created or open DBF then type Close Database command in command window.
            
       Syntax Or EX:- Close Database 
    
(Q) What is USE Command?
       
Ans:-When user wants to open any saved file , then type use command in command  window.
           (बनाये हुए फाइल के record को अगर देखना हो या फाइल से related कोई भी कार्य करना हो ,               तो सबसे पहले use command से फाइल को open करेंगे )    
              
            Syntax:-USE Dbf name 
           
               Ex:-     USE  Student 

  Note:- After type this command, filename and total records are shown in a number form.
                To display file date type LIST OR DISPLAY ALL Command in command window.

(Q)What is Browse Command?
    Ans:- To edit records of any create file  use BROWSE command in Command window.
      (बनाये हुए फाइल के record को change करने के लिए ब्राउज कमांड का USE करते है !)
     
      STEPS:-
              (i) Open any saved DBF by using USE command.
              (ii) Type BROWSE Command in COMMAND Window.
              (iii) Edit records where you want.
              (iv) Press shortcut key CTRL +W ,To save.
              
      For See(देखने के लिए ):-
              Type List/Display All Command in command window.  

(Q) What is CHANGE/EDIT Command?

Ans;-The change/Edit command provides full screen support or viewing and editing fields in a data base. The change and edit command are the same.
                           The difference between BROWSE and CHANGE/EDIT is that:-

                BROWSE displays records in table form where CHANGE/EDIT display records in a vertical form with a field occupied in line.

                   USE DBF  
                   CHANGE reocrod 2 
                       or
                   EDIT record 2  

(Q) How to modify Structure of any DBF?
   Ans:- To modify the Structure(Fields) of any Created DBF , type MODIFY STRUCTURE   command  in  Command Window.

   Steps:-
               (i) Open any saved DBF by using USE command.
              (ii) Type MODIFY STRUCTURE Command in COMMAND Window.
              (iii) Edit records where you want.
              (iv) Press shortcut key CTRL +W ,for save.                      

     For See(देखने के लिए ):-
             Type List/Display All Command in                      command window. 

(Q) What is APPEND Command?
  Ans:- If user wants to add/ insert any new record of any created  or Saved DBF, then type  APPEND command in Command Window.

    Steps:-(i) Open any saved DBF by using USE command.
               (ii) Type APPEND Command in COMMAND Window.
               (iii) Enter records for insert.
               (iv) Press shortcut key CTRL +W ,To save.  

       For See(देखने के लिए ):-
              Type List/Display All Command in command window. Then new inserted records also displayd on screen with previous records. 

(Q) What is INSERT command? How BEFORE,AFTER and BLANK are applied with                       INSERT  Command?     
Ans:-The APPEND command add new records at the end of file. However some times we want to insert a new record in after or before any record (middle of records) then, INSERT command will be used.

     INSERT BEFORE/AFTER/BLANK.

  BEFORE/AFTER/BLANK:- Here, BEFORE can be used to placed new record before the current  record and BLANK is used to new record immediately after the current record.    

For ex:- 
   ***  If courser on record no 3 and user type :-

               INSERT BEFORE in command window, then new record added on record  no 3.
  ***If courser on record no 3 and user type :-
                  
 INSERT AFTER in command window, then new record added on record   no 4.

  ***If courser on record no 3 and user type :-
                         INSERT BLANK in command window, then blank space appear on record no 3.
                         for insert record APPEND command is used.



          

(Q)What is DELETE command?
      Ans:- When user wants to delete any particular record from open DBF, Then type DELETE                          command from command window.After operate this command *(star) Symbol appear                          before deleted record .
   Syntax:- Delete record record No.  
     Ex:-      Delete rocord 2 
                
                Then after delete record 2 DBF displayed in following form.



 Student.dbf
Name Roll Marks Village
Ram           2               87            patna
*Sonu          5               78            Agra
Shyam       8               88            lacknow
Sima          7               60            Delhi


(Here deleted  record no 2 is preceded by *(star) Symbol ).

(Q) What is RECALL command?
Ans:- When user wants to RECALL any deleted record then type RECALL command in command              window. Its only applicable with deleted rocord.

     Syntax:- RECALL record Record No 
         Ex:- RECALL record 2 
(After type this command record no 2 is visible on screen without * symbol )


 Student.dbf
Name Roll Marks Village
Ram           2               87            patna
Sonu          5               78            Agra
Shyam       8               88            lacknow
Sima          7               60            Delhi




(Q) What is PACK command?


Ans:- When user wants to permanently delete of any deleted (A Record which before * symbol is                   appeared)record then use PACK command in command Window.


Syntax Or EX:- PACK
  
  For Ex:-


 Student.dbf
Name Roll Marks Village
Ram           2               87            patna
*Sonu          5               78            Agra
Shyam       8               88            lacknow
*Sima          7               60            Delhi

(Here in this upper table record 2 and 4 are deleted by delete command , so after Appily PACK command the table will be shown in following form:-)


 Student.dbf
Name Roll Marks Village
Ram           2               87            patna
Shyam       8               88            lacknow






(Q) What is ZAP command?
Ans:- ZAP command is used for delete all (Deleted or undeleted) records of any open DBF.

Syntax Or Ex:- ZAP 


 Student.dbf
Name Roll Marks Village
Ram           2               87            patna
*Sonu          5               78            Agra
Shyam       8               88            lacknow

*Sima          7               60            Delhi

(After appily ZAP command in upper table  all records will be deleted permanently and table will display in following form.)


 Student.dbf

Name Roll Marks Village

(Here only structure will be visible, and in status bar Record :-None is visualized.)

नोट :- Record  none  का मतलब यह है की, इस DBF  reocrd नहीं है !


(Q)What is difference between PACK and ZAP command?

Ans:- Pack  COmmand  का उपयोग किसी open DBF के सभी deleted record(जिस record के आगे  में  * का symbol  लगा हो )  को permanently    delete करने के लिए होता है 

              जबकि   ZAP command का उपयोग किसी open DBF से सभी तरह के records को (Deleted                 or Undeleted )रिकार्ड्स को permanently डिलीट करने के लिए होता है !



(Q)Clear Command:-
                            This command is used for clear an output screen.
          
                Syntax OR Ex:- 
                                              Clear 
(Q) What is (?) print command?

Ans:- ?(PRINT) command is used for display/print output on screen. This output be in the                     form of message or in value form.

     For print message :- 
                                       ?(Print) command is followed by some text within   double quotation                       mark(" ").

      ** If user wants to print Hello on output screen,Then:-
            
                                          ?"Hello"
        ** If x=5 and user wants to print Value of X on message on screen,Then:-

                                                     ?x

                                                        OR
                
                                           ?"value of x=",x

               (Here,end of double quotation marks comma(,) operator must be required).

(Q) What is ??(Double print) command?

Ans:-After print  result on screen,if user wants to display anothe message within same line ,Then ?? print command is used.(Print  command के द्वारा रिजल्ट print करने के बाद, User  उसी लाइन में फिर से कोई छूटा हुआ message print  करना चाहे ,तो ??(Double Print Command का उपयोग होगा !))

              Syntax OR Ex:- ?"Text1  "??"Text2 " 
      For Ex:- ?"Ram"
                      ?"kumar"


              This Output display in the form of:- Ram
                                                                            Kumar

       ** To display output in same line :-
                                      
                      ?"Ram" ??"kumar" 


(Q) What is  ??? command?

Ans:- If any computer system is connected with printer output device , Then ??? command is             used for display output on hardcopy. 

                Syntax Or Ex:-
                                    
                                         ??? 

                   
              
 (Q)What is MODIFY COMMAND ?
Ans:- To open Program Editor Box, type Modify command in command window. 

       Syntax:-MODIFY COMMAND program name 
         Ex:-      MODIFY COMMAND RAM 

     (After press enter key a new program Editor box will be open in new Editor box named                 with    Ram.prg, Here .prg. is an extension name of programmable file.)



(Q) How to run/Compile a program?
Ans:- DO command is used for Run/ compile a program.Do command is followed by program name.
 Syntax:- DO Program name


         

Fig:-Program Editor Box




(Q) SET TALK OFF:- 


                                   This command is used for Compilation of programm,line by line.
  Its,generally declared in header part of program files
        
             Syntax Or Ex:-
                                SET TALK OFF
(Q) SET ECHO OFF:-
                                 This command is used for keep Complete informatin of variable(Data types            ,size and Memory locaton) which  declared in program.

            Syntax Or Ex:-
                                 SET ECHO OFF

(Q)STORE 0 TO variable 1,Variable  2,Variable ..n:-
                                                  
             If user wants to declare numeric type variable in program ,then use this   command. Here in this command all variables(variaable 1, variable 2,variable n) are initialized with Zero ,because 0 is assigned.

       If user declare as:- Store 10 to x, then value of x be 10.

(Q)STORE "    " TO variable 1,Variable  2,Variable ..n:-
           
                If user wants to declare Character type variable in program Or Wants to store character type value in its,then use this  command.Here in this command all variables(variaable 1, variable 2,variable n) are character type, so its only store character type value.
     
For Ex:-
  Store "   " to name,fname,village

(Q)Input Command:-
                         
               If user wants to store numeric value in nemeric variable during run/ program                                execution  time then use Input command .

 Input command may be followed by message within double quotation marks("   ")and after        that comma(,) operator is required to separate a variable name.

 input command is used to store a single value, in a single variable at a time.


    For Ex:- Input "enter a no " to x
       (Here ,Input and To are keywords and x is a variable name. )


(Q)Accept Command:-

                              If user wants to input character/String type value in character variable during run/ program execution  time then use accept command .

 ⏩ Like Input command accept command also followed by message within double quotation marks("   ")and after that comma(,) operator is required to separate a variable name.

 ⏩ Accept command command is used to store value, in a single variable at a time.


    For Ex:- Accept "enter a no " to x
       (Here ,Accept and To are keywords and x is a variable name. )


(Q) What is Sort command?What are the advantage and disadvantage of Sort command?

Ans:- Sorting is a technique to arrange records of any open DBF in ascending and descending order.Its provide facility to arrange/sort records on the basis of any field of DBF.


Syntax:- Sort on field name to New Dbf name 

 Student.dbf
Sno   Name Roll Marks Village
  1        Ram           2               87            patna
  2       *amar         5               78            Agra
  3        Shyam       8               88          lacknow
  4        *Sima          7               60            Delhi


Ex:- Sort on name to Student2 

    Then, this DBF is Sorted in new DBF(Student2). For display its follow some steps :-

(i)open student2 Dbf by use command.
         
              Ex:- USE Student2  

 (ii)type LIST/ DISPLAY ALL in command window  then records display as:


 Student2.dbf
Sno     Name Roll Marks Village
  1         *amar         5               78            Agra
  2           Ram           2               87            patna
  3          Shyam       8               88        lacknow
  4          *Sima          7               60            Delhi

 ⏩ To arrange file in Descending order:-

   Syntax:- SORT ON FIELD NAME/d TO NEW DBF.

EX:- sort on name/d to student3 
               Then after open student3 Dbf, the table data arrange as:-

 Student2.dbf

Sno   Name Roll Marks Village
1   *Sima          7               60            Delhi
2     Shyam       8               88            lacknow
3     Ram           2               87            patna
4    *amar         5               78            Agra

    ⏩IF any record stored in capital letter and user wants to arrange its in ascending order then           according to ASCII(American Standard Code Information Interchange) value reocrd is             arranged. Such as:-
  
 Student2.dbf
Sno     Name Roll Marks Village
  1          RAM          2               87            patna
  2     *amar             5               78            Agra
  3          Shyam       8               88        lacknow
  4          *Sima          7               60            Delhi

 ⏩Here after sort RAM is stored at record no 1 because its ASCCII value is less than all records.To over come this user appily according to CASE facility to arrange its                            in sequential form.
Syntax:- sort on field name/c to new DBF

Ex:- Sort on name /c to stud3



** Advantage of Sorting command.

(i) After sort our Dbf will arrange in ascending / descending order

(ii) sorting provide facility for sort any file on the basis of any single or multiple field of Dbf.

(iii)Its create duplicate copy of file when ever sorting related operation is performed so, in any          case if data will be lost then user restore through duplicate copy of that file..

 ⏩Disadvantage of Sorting command.

 (i) When ever sorting related operation(arrange inc/dec) will be performed , then its each time 
     demand new Dbf name and allocate space in memory according to size of file.

(ii)Sorting is slow process.

(iii)After perform sorting operation its records are auto arrange, but its record numbers are not common according to previous data.It means:-

(iv)Sorting command never sort record no of file.

(v) FIND and SEEK command not performed with sorted Dbf .

(Q) What is Indexing? How its better than sorting?

Ans:- Like sorting an Indexing is another technique to sort records of any open dbf in ascending and descending order. In other words we can say that indexing is a term to arrange records of any open Dbf in ascending or descending order.This task will performed on the basis of single or more fields.

Syntax:- Index on field name to DBF name. 


 Student.dbf 
 Sno   Name Roll Marks Village
   1        Ram           2               87            patna
   2       *amar         5               78            Agra
   3        Shyam       8               88         lacknow
   4        *Sima          7               60            Delhi

Ex:- Index on Name to student 

After type list/display all command in command window the Dbf display as:-

 Student.dbf
Sno    Name Roll Marks Village
 2         *amar         5               78            Agra
 1         Ram           2               87            patna
 3          Shyam       8               88         lacknow
 4        *Sima          7               60            Delhi


(Q)  What are the Similarities and  Differences between Sorting and Indexing?
Ans:- There are following Similarities between Sorting and Indexing.

(i)Sorting and indexing both are turm in Foxpro to arrange records of our DBF in ascending  order. 
(ii)Sorting and indexing both commands provides facility to operate on the basis of single or multiple fields. (Sorting or indexing दोनों command का operation  एक या एक से अधिक  fields  को लेकर कर  सकते हैं !)


** There are following Differences between Sorting and Indexing.


(i) Sorting is slow process where as 
                 Indexing is fast process than Sorting.
(ii) Sorted Database file extension is .DBF where as
                 Index file extension is .IDX.
(iii) Sorting command with each operation stored in new DBF and allocate extra space according to size of file , where as Indexing command  perform all operation with  same file,so there is no required extra space in memory and not require new name .
        (Sorting command perform करने पर प्रत्येक बार यह new DBF  का नाम मांगता है और file  के साइज के अनुसार यह मेमोरी में extra space लेता है , )
(iv) Sorting command failure to sort no with records,due to this reason, each time record no are not common to previous record. but 
                                 Index command has capability to sort with record no, so not   vary to previous records.
(v)  FIND and SEEK command are not allowed with sorted file where as 
                           FIND and SEEK commands are allow with index file.



(Q) ERASE COMMAND:-

                  Erase command is used for delete any Data base file. 

           (ERASE  command  का  उपयोग किसी database  फाइल को Delete   करने के लिए होता है ! )

Syntax :- ERASE  filename .DBF 
    Ex :-      ERASE  STUdENT  .DBF 
                 (Here STUDENT is the name of DBF. )
  नोट :-* किसी DBF को delete करने के लिए ये जरूरी है की file  colse  mode  में हो !
            ** अगर file  open  हो और user  उसे delete  करना चाहे तोfile is  in use के नाम से              एक  error  message  show करेगा !
           
(Q) What is report?How to create a report? How to print preview the report?
Ans:-
             Report is a technique, which provide facility for arrange our result page in suitable form.

 For creating the report in database file and arranged its in suitable form  follow suitable syntax.
       
            USE DBF 

        CREATE REPORT
Then after a box will be appeared with header, middle and  footer part of visual box. The header part accept the name of DBF, Middle part display fields name, and there contains and footer part display the page no and comments , which appilied by the user.

      Go  to Report menu and select quick report option also select for arranging the data either row or column and finally press ok button. After this event select print preview which available
in to file menu to display the all there contains. 
   
To print preview of report, go  to file menu and select print preview ,then records of file will be open in new form.

*** Feature and Utilities of Report:-

After creating the DBF user create the report with suitable extension(*.frx) which stores into related of the DBF. Its feature is given below.
(i) The total field will be seprated either column or row with suitable contains.
(ii) For printing user add the details in to the design dilogbox either header details of footer parts. Its also give the page no of each reported pages and function also. The feature of report pages also grouped or arrange according to the feild name and there value also.
(iii)In this file also provides applying for style,alignment when you select the field , which appear into header part of report file.
(iv) For displaying the data or records print preview option also applicable on the repor file, not data base file. It means user produced all the details by pressing "M or D" (more or done). It is also the characteristics of report.

*(विशेषता )Utilities of Report:-

(i) Our DBF does not provides any options or command with page no, calculaton with respect to sorting , but here that is report file also gives the printing formet according to user application. There for printing and grouping it is very necessary or useful for the user.


(Q) DISPLAY MEMORY:-


        Display memory command is used for display System variables of foxpro application.

Syntax:-
          DISPLAY MEMORY 
(Q) RELEASE ALL OR CLEAR MEMORY:-
                    RELEASE ALL OR CLEAR MEMORY command is used for delete total memory variable which declared by user.

For ex:- Suppose user declare in command window as:-

    a=10
    b='xyz'
    c="Ram"
    d=date()

here , upper 4 variable can be displayed by using display memory command.

*For delete this command user type RELEASE ALL   CLEAR MEMORY  in command window.
* To confirm this deletion ,user againg type DISPLAY ALL  in command window.

**IF user wants to delete any particular variable then,
 
          RELEASE a,b 

**RELEASE ALL LIKE A*:- This command is used for delete all variable which start form A variable.

** RELEASE ALL EXCEPT P???:-
          This command is used for delete all variable which start form P, here ??? means after P variable escape three characters all variable will be deleted.


 **@ command:-
             To display the field,variable function or data on the specified position of the screen use this symbol.
           In our screen  there are 80 columns in each row and 25 rows for printing. when user address our variable for displaying the first column known as column Zero and last Column known as  79, Simillarly  first row known as Zero row and last row represent as 24 there for we can say that extreme right corner of the field or variable addressing represented as 24,79

Syntax:- @ row,column SAY date() 
Ex:-       @ 10,15  SAY date() 

** @  GET  Command (@..SAY...GET):->

          This command is used to display the correct value of the GET variable. Here field or variable name is specified with @......SAY......GET.These command is combind with READ command.


Clear

store "abhishek" to a
@ 5,6 say "enter name"get a
read

Then , output shown as:-

enter name abhishek


(Q)@ ....EDIT command:-
        The @....EDIT command is quit simillar to @ ......GET command. The @...EDIT can be used only with the char field or variable or a memo field.

Syntax:- USE DBF 
@ row, column  EDIT    FIELD NAME  SIZE  Length Size, Width Size  

EX:- USE STUDENT.Dbf 
              GO TO RECORD 2 
     @ 5,6  EDIT  NAME SIZE  3,20 

(Q) What is READ and READ CYCLE Command?
Ans:- READ and READ CYCLE Commands are used in our  Footer position of program.

           READ command execute one time and display on the screen .
                               
                But , READ CYCLE Command execute more than one times . which has not ending possition for quit the program.

  To forcefully execute form READ CYCLE press ESCAPE button. 
   EX:-
   WAP to Store variable value.
     
        SET TALK OFF
        SET ECHO OFF
CLEAR
STORE SPACE (20) TO NAME
STORE 0 TO comp, math,eng

@ 2,5 say "-----------------------Data Entry Program--------------"

@ 5,5 SAY "Enter name of students" GET name               

@ 7,5 SAY  "Enter Marks of Computer paper" GET comp

@ 9,9 SAY "Enter Marks of math paper" GET math

@ 11,5 SAY "Enter Marks of English Paper" GET eng

READ CYCLE

return

CTRL  + w

(Q) WAP  to enter any no and repeat its in by using infinite  time.. 

clear
stor 10 to n
@ 5,0 say "1st number " get n

read cycle






OUTPUT:-
                          
                           --------------------Data Entry Program------------------------

                          Enter name of students   Ram

                          Enter Marks of Computer paper  77

                          Enter Marks of math paper           69

                          Enter Marks of English Paper     68




(Q) What is Memory variable? What are the rules for declare a Memory Variable? How to create a memory variable?



Ans:-Data items store in RAM is called  memory variable. For each data items we need to assign a unique name.

Rules for delclare a memory variable:-

(i) Memory variable name should begin with alphabet and may be followed by numbers.

(ii) We can not use Space or punctuation marks in memory variable name.

(iii) Memeory variabale name can begin with a underscore character but its advisable to avoid it.

(iv) Memory variables are used for store a data entered by the user in memory.


***How to create a Memory Variable.

 We can create a memory variable by using STORE command.


*** There are following technique used for create a memory variable.

(i) STORE Command:-
                                      This command is used for create a memory variable for store any value.

     Syntax:- STORE 0 to variable1, Variable....n

Ex:-              STORE 0 to n

             (Here, 0 is a numeric data and n is a numeric varibale. )


(ii) To Create a character type memory variable, enclosed data within Single or double quotaion marks(" ").

Ex:-  
         STORE  "Ramesh "  to s_nm
         STORE   'R_5'    to roll
        STORE    [Abhi] to nm

(iii) To create a logical type memory variable , enclosed the data within dots(.) . 


For ex:-

    STORE .T. to Present

   STORE .F.  to Absent


(iv)  To create a Date type memory variabe :-

   STORE Date() to cur_date

             NOTE:-  This command retrives the date maintain by DOS.

             
             For store any speific date enclosed the date in Curly brackets ({ } )


STORE {10/12/2020} to Exam_date


(v) By using = to create memory varibale.

        SN=1

        d=date() 

(vi)  Creating Empty memory variable:-

    SPACE () Creates an empty char type memory variable.

Country  =Space (15)

(vii)  Creating Array memory varibale:-

    By using dimension or declare command we create Array varibale.

         DIMENSION  ar(5)

   Here ar(5) creates five index in memory .Such as:-

             ar[1]    ar[2]    ar[3]     ar[4]     ar[5]   


***Clearing Memory Variable:-

        If user wants to clear memory variable then use:-


        RELEASE  ALL 
               OR
        CLEAR MEMORY 
               OR
        CLEAR ALL  








(Q) wap to print simple message as output.

      steps:- type modify command new  in command window, then a program editor box open with new.prg title. now type program in editor box and after type run this program with do prg name.
such as:-



SET TALK OFF
SET ECHO OFF
 clear
  ?"bca3yr.blogspot.com"
  return
ctrl +w (sortcut key press here )

** Now type  Do prg name in program window to run.

Output:- bca3yr.blogspot.com

(Q) Wap to print your name, city name and display its.

SET TALK OFF
SET ECHO OFF
 clear
  ?"My name is  bca3yr.blogspot.com"
  ?" My city name= Patna"
return

ctrl+w


Output:-My name is  bca3yr.blogspot.com
              My city name= Patna

(Q) Wap to enter any two numbers and display its.


SET TALK OFF
SET ECHO OFF
 clear
   Store 0 to a,b
 a=10                                                      // Declaration time value assign in a
INPUT "Enter 2nd no :-" to b               //program execution time value assign in b
?"Sum of a and b=", a+b
return
ctrl +w


Output:- Enter a no   :-  10
              Enter 2nd no:- 20
              Sum of a and b= 30

(Q) Wap to enter any your name,roll also enter three subjects marks and display its.

SET TALK OFF
SET ECHO OFF
 clear
   Store "  " to name
   Store 0 to roll, sub1,sub2,sub3 
  
 INPUT "Enter roll no :-" TO  roll
 INPUT  "Enter 1st subject marks :-" TO sub1
 INPUT "Enter 2nd subject marks :-" TO sub2
 INPUT "Enter 3rd subject marks :-"  TO sub3

?"Total marks=", sub1+sub2+sub3

return
 ctrl+ w

Output:-Enter roll no      5
Enter 1st subject marks:- 60
Enter 2nd subject marks:-70
Enter 3rd subject marks:-50
Total marks=120



(Q) Wap to enter any two no and perform all arithmatic operation


SET TALK OFF
SET ECHO OFF
 clear
  
   Store 0  to a,b

INPUT "Enter a no" to  a
INPUT "Enter a no" to b

?"addtion of a and b =",a+b
?"addtion of a and b =",a-b
?"addtion of a and b =",a*b
?"addtion of a and b =",a/b
?" modules of a and b=",a%b
return
Ctrl +w


Output                      
Enter a no    12           
   Enter a no       5             
 addtion of a and b =   17
Subtraction of a and b =  7
Multiplication of a and b =  60
Division of a and b =  2
Modules of a and b=  2
(Here modules return remender value)

set talk off
set echo off                        
clear                                
store 0 to i,j                       
for i=5 to 1  step -1                      
 ?                                   
 ?                                       
  for j= 1 to i                         
   ?? "   @"                           
  next                              
  
next
retu
    
   
(Q) Wap to enter length and Width of Rectangle and print its area and perimeter.

Set Talk off
Set Echo off
Clear
Store 0 to L,W,area,peri

INPUT "Enter length of Rectangle" to L
INPUT "Width of rectangle" to W
 area= L *W
 peri=2(L + W) 

?"Area of Rectangle=",area
?"Perimeter of Rectangle=",peri
return
Ctrl  + w
                     Output:- 
                     Enter length of Rectangle   4
                       Width of rectangle     5
                     Area of Rectangle =20
                      Area of peri

(Q) WAP to open any database file and display its record by using SCAN -----Endscan.
use std3
set talk off
set echo off
clear
store 0 to n

input "enter roll no" to n

scan for roll= n
  ?"  student name=",stud_nm
  ?"  roll no=",roll
  
  ?"  village =",village
endscan

return
(3)Wap in foxpro by using switch  case  and  text……ENDTEXT  where input any one numbers and perform  following operations.   (15)

(i)Press 1 for factorial
(ii)Press 2 for find even or odd.
(iii)Press 3 for find prime no or not
(iv)Press 4 for find Armstrong  no or not.

(v)Press 5 for exit

set talk off
set echo off
clear
store 0 to ch,n,f,c,i,m,t,arm


text
  press 1 to find factorial no
  press 2 for find even or odd no
  Press 3 for find prime no or not
  Press 4 for find Armstrong  no or not.
  Press 5 for exit

endtext


input"enter a no"to ch
do case
case ch=1
input "enter a no to find factorial no" to n  
   f=1

   do while n>0
     f=f*n
     n=n-1
   enddo
    ?"factorial no=",f

     
 case ch=2
   input "enter a no to check even or odd" to n
    if n%2=0
      ?"even no"
    else
      ?"Odd no"
    endif        

      case  ch=3

 
i=1
input"enter a no to check prime no" to n

do while(i<=n)
    if n % i=0 then
       c=c+1
       endif
       i=i+1
   enddo
 
      if c==2 then
        ?"prime no"
      else
        ?"not prime no"
      endif

case ch=4

input"enter a no between 1 to 1000 to check prime no"to n
   t=n                             
  do while n>0                    
                               
    m=n % 10                  
   arm=arm+(m*m*m)             
   n=int(n/10)            
                    
enddo

if arm==t then                     
    ?"armstorng no"
else 
    ?"not armstorng no"
endif
 
 return 
  



     case ch=5
        quit
   endcase

return
(Q)(4) WAP in which open any data base file and perform following command in its.   (15)

     (i) 1 for append any new records.

     (ii) 2 for list

     (iii) 3 for browse

     (iv) for modify structure.

      (v) for change records.

      (vi) for exit

use std3
  set talk off
  set echo off
  
  clear
   
 store 0  to n
 text
 Press 1 for append any new records.

     Press 2 for list

     Press 3 for browse

     Press 4 for modify structure.

      Press 5 for change records.

      Press for exit


 endtext
 
  input "enter a no  " to n
 if n=1 then
  APPEND
 endif
 if n=2 then
   LIST
 endif
 
 if n=3 
  browse
 endif
 
  if n=4
   MODIFY STRUCTURE
  endif  
 if n=5
   CHANGE
 endif
if n=6
  EXIT
endif
retu
    

  

  





 ***Lmitation with DBMS:- 

DBMS based on Single user system. A Single user can easily acceass with a  single file, so DBMS limit with a small organisation and failure to access more than one file at a time. To over come this problem DBMS will be reformed in the form of RDBMS.

(Q) What is RDBMS ?

Ans:- RDBMS stands for Relational Data Base Management  system. RDBMS provides facility to Access multiple files at a single time with singel or multiple user. Due to this property RDBMS will be used in large organisation. RDBMS follow the relue of set theory like join , union , Intersection .  RDBMS be in the form of table . It based on multiuser such as Mainfrem , mini or super computer.  RDBMS capable to manage large data for huge organisation .In the case of  RDBMS one file relate with another file after check the relation integrity. foxpro is an example of  RDBMS.


***Multiple Data base File:-

Foxpro 2.6 (dos version) currently open 25 files at the same time. when user defind the area either character or numeric in command window, but another windows based foxpro open 225 data base file at the same time and display the record any where.

               The character representation like A to J (10) also defind the area and open multiple files on the screen ,but user use Number like 1 to 25 or 225 with SELECT Command . Our file open on the screen in the form of cascade.
***SELECT COMMAND:-
                 When user wants to open multiple  file at a time ,then use SELECT Command in command window.

       Syntax:-  SELECT A                 or   SELECT 1

               ** After SELECT command open any DBF  by using USE command.

            Then after create index to the linked file and follow comman field of both database file.

            After indexing use SET RELATION COMMAND for linking the Two DBF.


(Q) SET RELATION COMMAND:-
         After open multiple file , if user wants to stable relation between both data base file then use  this command.

Syntax:-  SELECT 1  
       USE STUDENT 
       


         SELECT 2 
         USE STUDENT1  
   
Syntax:-  
 SET RELATION TO FILED NAME INTO DATABASE2  
 Ex:-

 SET RELATION TO Roll INTO student

    
EX:-  Student.DBF

Roll  Name       Marks    
  2      Ram          87          
  5      Sonu         78          
8      Shyam      88          




Student1.DBF

Roll  Name           City
  2      Ram           patna
  5      Sonu           Agra
8      Shyam        lacknow


  In upper there are two database file. 

(Q) How to Relate both DBF (student  and  student1)  and display roll,name, city of all                       students?

Ans:-    Write following commands in command window.

          SELECT 1  
       USE STUDENT 
       INDEX ON ROLL TO STUDENT 


         SELECT 2 
         USE STUDENT1  
       INDEX ON ROLL TO STUDENT1

   SET RELATION TO ROLL INTO STUDENT 

LIST STUDENT ->ROLL, STUDENT1. CITY, STUDENT -> MARKS, STUDENT1. NAME 




          





***Display Status:-

              After open more than one files when user wants to display processor name,path, alias name,area, code page no of DBF file then,use this command into  command window.

               Syntax or EX:-
                 
                  SELECT A 
                   USE STUDENT.DBF 
                    
                   SELECT B 

                   USE STUDENT1.DBF 

               ** For display the both Database file properties type:-

                 DISPLAY  STATUS  in command window.
  
                 

                      

                       DISPLAY STATUS 


(Q)COPY STRUCTURE COMMAND:-
                                         When user wants to Create copy of the structure (field, field type , width) of open DBF and store into another database file, then follow suitable syntax.

                 Syntax:- COPY STRUCTURE TO new DBF 

For see type command window in:-

                USE  new DBF 
                  COPU STRUCTRUE TO NEW DBF 
  देखने के  लिए :-
                    USE NEW dbf  
                and also type  DISPLAY STRUCTURE 

(Q) COPY TO COMMAND:-

  In command window user wants to create copy of all records and store into another DBF, then use this syntax.

Syntax:-  COPY TO  newDBF  

For see type command window in:-

                USE  new DBF 

                and also type  LIST 


(Q) APPEND  FROM:-
                                        For adding all the records into another file,which has same field ,width and suitable field type.

Syntax:- USE  DBF1 

 Append FROM DBF2  
(Then DBF2 all records store into DBF1.)

APPEND FROM DBF FOR roll <=50 





_________________________________________________________________________________





*Forms:- The form is the most important visible object, without it no control can be displayed.
      A form is define as a container which can hold several controls to design an interface.A form is also defined as a layout on which we can place the control at desired location  to create an interactive interface.

(Q) How to create Fprm in forxpro?

Ans:--
      To create/design a form user type CREATE FORM COMMAND in command window.
       After type this command a form will be open as:-

     



Syntax:--  CREATE FROM Form name 
Ex:-          CREATE Form student 

Then a form designer box open with tool box and properties window.




*Properties Window:-
                                   The properties window shows the properties of currently selected control on the form.These properties are characteristics (Such as size visible,color,font,etc.) of the selected object and it provides an easy way to set properties.Form is also considered as a control and it also have some properties.
               We can list the properties of the selected             object in two views-Alphabetic and categorized.
  


  
 Fig :-properties Windows 

    * The left part of properties window shows the property name and the right part shows the            property value regarding each property.
                                               
    * We can change the only right part i.e. property value. 

    *The properties of any control can be changed either from properties window at design time or              from code window during coding .

    *If we chaange the properties of any control at sesign time then it will effect immediately i.e.                before execution but if we change the properties at the code window then it will be effected run          time.



    * We have to follow the following syntax to change the properties of any control at code window.





Comments

  1. It's very helpful sir👌🏾👌🏾

    ReplyDelete
  2. Thanks for this information sir

    ReplyDelete
  3. very interesting sir👍👍👍👍👍👍❤️❤️❤️😷😷😷😷😷😷

    ReplyDelete
  4. Very useful sir. Special thanks to you

    ReplyDelete

Post a Comment

Popular posts from this blog

DATA STRUCTURE

Visual Basic 6.0